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
PyCharm 2019.3 does lookup for module attributes from yarl/__init__.pyi and as Query and QueryVariable are declared there, it assumes they exist in the yarl/__init__.py, but those two type variables are not declared there. So doing: from yarl import Query, QueryVariable is totally legal for PyCharm, but will throw ImportError in runtime.
As Query and QueryVariable sound very much like they're part of API, I think, it will be a rational move to solve this issue.
Naive solutions:
Declare __all__ in .pyi, which didn't work out for me
Add _ prefix to Query and QueryVariable making them "protected members" of interface file.
Declare same types in __init__.py. I don't think this is a good idea.
The text was updated successfully, but these errors were encountered:
PyCharm 2019.3 does lookup for module attributes from
yarl/__init__.pyi
and asQuery
andQueryVariable
are declared there, it assumes they exist in theyarl/__init__.py
, but those two type variables are not declared there. So doing:from yarl import Query, QueryVariable
is totally legal for PyCharm, but will throwImportError
in runtime.As
Query
andQueryVariable
sound very much like they're part of API, I think, it will be a rational move to solve this issue.Naive solutions:
__all__
in.pyi
, which didn't work out for me_
prefix toQuery
andQueryVariable
making them "protected members" of interface file.__init__.py
. I don't think this is a good idea.The text was updated successfully, but these errors were encountered: