mirror of
https://github.com/python/cpython.git
synced 2025-10-07 07:31:46 +00:00
bpo-46244: Remove __slots__ from typing.TypeVar, .ParamSpec (#30444)
* add missing __slots__ to typing._TypeVarLike * add news entry * remove slots from _TypeVarLike base classes * cleanup diff * fix broken link in blurb
This commit is contained in:
parent
6223cbf86a
commit
081a214008
2 changed files with 2 additions and 6 deletions
|
@ -805,9 +805,6 @@ class TypeVar( _Final, _Immutable, _TypeVarLike, _root=True):
|
||||||
Note that only type variables defined in global scope can be pickled.
|
Note that only type variables defined in global scope can be pickled.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__slots__ = ('__name__', '__bound__', '__constraints__',
|
|
||||||
'__covariant__', '__contravariant__', '__dict__')
|
|
||||||
|
|
||||||
def __init__(self, name, *constraints, bound=None,
|
def __init__(self, name, *constraints, bound=None,
|
||||||
covariant=False, contravariant=False):
|
covariant=False, contravariant=False):
|
||||||
self.__name__ = name
|
self.__name__ = name
|
||||||
|
@ -907,9 +904,6 @@ class ParamSpec(_Final, _Immutable, _TypeVarLike, _root=True):
|
||||||
be pickled.
|
be pickled.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__slots__ = ('__name__', '__bound__', '__covariant__', '__contravariant__',
|
|
||||||
'__dict__')
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def args(self):
|
def args(self):
|
||||||
return ParamSpecArgs(self)
|
return ParamSpecArgs(self)
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Removed ``__slots__`` from :class:`typing.ParamSpec` and :class:`typing.TypeVar`.
|
||||||
|
They served no purpose. Patch by Arie Bovenberg.
|
Loading…
Add table
Add a link
Reference in a new issue