]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-33652: Remove __getstate__ and __setstate__ methods in typing. (GH-7144)
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 28 May 2018 10:54:56 +0000 (13:54 +0300)
committerIvan Levkivskyi <levkivskyi@gmail.com>
Mon, 28 May 2018 10:54:56 +0000 (11:54 +0100)
Lib/typing.py

index e9265afce491655075123a5aecc8d10838f235ec..a95eb2e184a0f44a724b3d62835dd7eab28dcc83 100644 (file)
@@ -294,13 +294,6 @@ class _SpecialForm(_Final, _Immutable, _root=True):
 
     __slots__ = ('_name', '_doc')
 
-    def __getstate__(self):
-        return {'name': self._name, 'doc': self._doc}
-
-    def __setstate__(self, state):
-        self._name = state['name']
-        self._doc = state['doc']
-
     def __new__(cls, *args, **kwds):
         """Constructor.
 
@@ -555,20 +548,6 @@ class TypeVar(_Final, _Immutable, _root=True):
         if def_mod != 'typing':
             self.__module__ = def_mod
 
-    def __getstate__(self):
-        return {'name': self.__name__,
-                'bound': self.__bound__,
-                'constraints': self.__constraints__,
-                'co': self.__covariant__,
-                'contra': self.__contravariant__}
-
-    def __setstate__(self, state):
-        self.__name__ = state['name']
-        self.__bound__ = state['bound']
-        self.__constraints__ = state['constraints']
-        self.__covariant__ = state['co']
-        self.__contravariant__ = state['contra']
-
     def __repr__(self):
         if self.__covariant__:
             prefix = '+'