Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.1k
Infer empty list without annotation for__slots__ and module__all__#19348
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Infer empty list without annotation for__slots__ and module__all__#19348
Uh oh!
There was an error while loading.Please reload this page.
Conversation
__slots____slots____slots____slots__ and module__all__ This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading.Please reload this page.
This comment has been minimized.
This comment has been minimized.
sobolevn left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thank you!
According tomypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
1091321 intopython:masterUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Fixes#10870,fixes#10103.
This adds a fake
Iterable[str]context when checking the following:__all__ = []at top level__slots__ = []at class level (also works for sets but not for dicts)Additionally, this fixes a bug with
__slots__being mistakenly checked in other contexts (at top level or in function bodies), so e.g. the following is now accepted: