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
Add __slots__
to typing._NotIterable
#92570
Conversation
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 |
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._NotIterable
as a mixin totyping._SpecialForm
, which defines__slots__
as an optimisation technique. However,typing._NotIterable
does not define__slots__
, meaning the the__slots__
declaration ontyping._SpecialForm
is 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
.