Is your feature request related to a problem? Please describe.
A clear and concise description of the problem.
from .some_packages import some_function
__all__ = ["some_function"]
I think above code should not raise any warnings nor errors, but pyright 1.0.53 raises an error like error: Import 'some_function' is not accessed.
A static analyzer may not fully support this feature because value of __all__ can be dynamic. But it would be much better if pyright supports this feature even though partially.
Thanks for the suggestion. This will be included in the next version of pyright.
https://github.com/microsoft/python-language-server/issues/619
FYI, python-language-server removed support of __all__ for reason:
commonly used libraries are using it in ways we can't handle yet.
Not sure what's those libraries and how they can't handle.
Yeah, I'm not planning to honor __all__ in terms of import mechanics, but I think it's reasonable to mark the referenced symbols as "accessed" so pyright doesn't report them as unaccessed.
Fair point.
Didn't read the issue description clearly enough and thought those two issue were simillar.
This support is included in 1.0.54, which I just published.
I installed new version and checked it working well!! Thank you for maintaining this amazing project!
Most helpful comment
This support is included in 1.0.54, which I just published.