-
Notifications
You must be signed in to change notification settings - Fork 770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error message for __all__
operations
#2137
Comments
It appears that this was fixed previously in this release of pyright Point 4 |
This is an incorrect usage of __all__ = ("AllBug",) or __all__ = ["AllBug"] |
Sorry and thanks eric |
You need to include a list of strings in the tuple, as in |
Oh my goodness sorry about that, I kept checking and couldnt see the difference, thank you. |
Funny how this works: import abc
class AbstractTradingStrategy(abc.ABC):
pass
__all__ = ["AbstractTradingStrategy"] but this fails: import abc
class AbstractTradingStrategy(abc.ABC):
pass
__all__ = [AbstractTradingStrategy.__name__] ## WARNING HERE! |
@xeroc, that's correct. The first example is supported by type checkers and the second is not. Refer to this documentation for a full list of supported expression forms supported for |
Thanks for the explanation and the link. |
I presume autoflake is a linter and code formatter? If so, this sounds like a bug in the linter. It should treat a symbol as referenced if it appears in the |
Thanks for pointing me to the right direction. Turns out autoflake has a parameter for that already: Sorry for bothering you for nothing. |
Environment data
Expected behaviour
Shouldn't error with the
__all__
operations.Code Snippet / Additional information
test.py
__init__.py
Error message - Operation on "all" is not supported, so exported symbol list may be incorrect
The text was updated successfully, but these errors were encountered: