Skip to content

Commit 97b523d

Browse files
serhiy-storchakailevkivskyi
authored andcommitted
bpo-33652: Remove __getstate__ and __setstate__ methods in typing. (GH-7144)
1 parent c651275 commit 97b523d

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

Lib/typing.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -294,13 +294,6 @@ class _SpecialForm(_Final, _Immutable, _root=True):
294294

295295
__slots__ = ('_name', '_doc')
296296

297-
def __getstate__(self):
298-
return {'name': self._name, 'doc': self._doc}
299-
300-
def __setstate__(self, state):
301-
self._name = state['name']
302-
self._doc = state['doc']
303-
304297
def __new__(cls, *args, **kwds):
305298
"""Constructor.
306299
@@ -555,20 +548,6 @@ def __init__(self, name, *constraints, bound=None,
555548
if def_mod != 'typing':
556549
self.__module__ = def_mod
557550

558-
def __getstate__(self):
559-
return {'name': self.__name__,
560-
'bound': self.__bound__,
561-
'constraints': self.__constraints__,
562-
'co': self.__covariant__,
563-
'contra': self.__contravariant__}
564-
565-
def __setstate__(self, state):
566-
self.__name__ = state['name']
567-
self.__bound__ = state['bound']
568-
self.__constraints__ = state['constraints']
569-
self.__covariant__ = state['co']
570-
self.__contravariant__ = state['contra']
571-
572551
def __repr__(self):
573552
if self.__covariant__:
574553
prefix = '+'

0 commit comments

Comments
 (0)