-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Description
Since mypy now supports __slots__ checking, we can add __slots__ to stubs.
This will allow us to correctly raise Something is not in __slots__ when assigning extra attributes.
Right now there are no __slots__ defined: https://github.com/python/typeshed/search?q=__slots__
If this is something we are going for, there are several things to consider:
-
Adding this feature to
stubtest. It can check that__slots__contents do match. Probably behind a feature flag. We can enable it forstdlibonly -
Should we allow skipping
_protectedattributes? For example, if some class is defined asclass A: __slots__ = ('_prop',)
Should we allow this stub?
class A: __slots__ = ()
Metadata
Metadata
Assignees
Labels
No labels