diff --git a/Lib/typing.py b/Lib/typing.py index ae1dd5c2d76891..d520f6b2e1b3d4 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -805,9 +805,6 @@ def longest(x: A, y: A) -> A: 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, covariant=False, contravariant=False): self.__name__ = name @@ -907,9 +904,6 @@ def add_two(x: float, y: float) -> float: be pickled. """ - __slots__ = ('__name__', '__bound__', '__covariant__', '__contravariant__', - '__dict__') - @property def args(self): return ParamSpecArgs(self) diff --git a/Misc/NEWS.d/next/Library/2022-01-06-21-31-14.bpo-46244.hjyfJj.rst b/Misc/NEWS.d/next/Library/2022-01-06-21-31-14.bpo-46244.hjyfJj.rst new file mode 100644 index 00000000000000..5ca536a97c9cd2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-01-06-21-31-14.bpo-46244.hjyfJj.rst @@ -0,0 +1,2 @@ +Removed ``__slots__`` from :class:`typing.ParamSpec` and :class:`typing.TypeVar`. +They served no purpose. Patch by Arie Bovenberg.