mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-43224: Add TypeVarTuple.__name__ (GH-31954)
I noticed that TypeVar and ParamSpec put their name in a __name__ attribute, but TypeVarTuple doesn't. Let's be consistent.
This commit is contained in:
parent
d0a91bd277
commit
3a2b89580d
2 changed files with 8 additions and 11 deletions
|
@ -939,13 +939,13 @@ class TypeVarTuple(_Final, _Immutable, _root=True):
|
|||
"""
|
||||
|
||||
def __init__(self, name):
|
||||
self._name = name
|
||||
self.__name__ = name
|
||||
|
||||
def __iter__(self):
|
||||
yield Unpack[self]
|
||||
|
||||
def __repr__(self):
|
||||
return self._name
|
||||
return self.__name__
|
||||
|
||||
def __typing_subst__(self, arg):
|
||||
raise AssertionError
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue