We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
instance.__slots__
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
Here's a minimal repro:
class Bar(object): ... reveal_type(Bar.__slots__) reveal_type(Bar().__slots__)
Output:
out/ex.py:6: note: Revealed type is "typing.Iterable[builtins.str]" out/ex.py:7: note: Revealed type is "typing.Iterable[builtins.str]"
What happens in runtime?
>>> class Bar(object): ... ... ... >>> Bar.__slots__ Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: type object 'Bar' has no attribute '__slots__'. Did you mean: '__class__'? >>> Bar().__slots__ Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'Bar' object has no attribute '__slots__'. Did you mean: '__class__'?
__slots__ are special.
__slots__
Related #11885
The text was updated successfully, but these errors were encountered:
builtins.object
Does the typeshed change fix this, or do you want to use this issue to track special-casing in mypy?
Sorry, something went wrong.
Any
Protocol
Mypy now reports an error on both lines.
No branches or pull requests
Here's a minimal repro:
Output:
What happens in runtime?
__slots__
are special.Related #11885
The text was updated successfully, but these errors were encountered: