You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having a minor issue with linting that is caused by the import mechanism that casefy uses. Specifically, if we use casefy as documented, the Pyright type checker reports that we are using a private import:
importcasefyPascalCase=casefy.pascalcase# <- this line triggers a reportPrivateImportUsage error
The reason is that, although __init__.py imports the symbols e.g. pascalcase, they are considered private according to type checker rules unless they are re-exported via the __all__ mechanism.
The workarounds are:
Suppress the type checker error.
Import the casefy module directly i.e. from casefy import casefy. This makes the symbols externally visible.
The fix is to re-export all the symbols in __init__.py as follows:
First of all, thanks for casefy!
I'm having a minor issue with linting that is caused by the import mechanism that casefy uses. Specifically, if we use casefy as documented, the Pyright type checker reports that we are using a private import:
The reason is that, although
__init__.py
imports the symbols e.g.pascalcase
, they are considered private according to type checker rules unless they are re-exported via the__all__
mechanism.The workarounds are:
casefy
module directly i.e.from casefy import casefy
. This makes the symbols externally visible.The fix is to re-export all the symbols in
__init__.py
as follows:I'm happy to create a PR if you like.
The text was updated successfully, but these errors were encountered: