Closed
Description
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.
Related #11885