-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
Add __slots__ to typing._NotIterable
#92570
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
Conversation
gvanrossum
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.
LGTM. (Though didn't we once try to assess the effect of those slots and failed to find any?)
Those were different slots I think :) |
|
Thanks @AlexWaygood for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
|
GH-92617 is a backport of this pull request to the 3.11 branch. |
(cherry picked from commit eef47d5) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
4739997 added
typing._NotIterableas a mixin totyping._SpecialForm, which defines__slots__as an optimisation technique. However,typing._NotIterabledoes not define__slots__, meaning the the__slots__declaration ontyping._SpecialFormis now meaningless, since all base classes must define__slots__in order for a__slots__declaration on a subclass to have any effect.This PR adds
__slots__ = ()totyping._NotIterable.