diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-05-11 03:30:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-11 03:30:47 (GMT) |
commit | c5444b355695755035d4a5cadc0467e850bb04c2 (patch) | |
tree | 809e261fb4bd69bfd25beccc7a8c2bc8ed21bb66 /Lib/typing.py | |
parent | 22df4187c3882c6ec67180902e1151e65b03aee0 (diff) | |
download | cpython-c5444b355695755035d4a5cadc0467e850bb04c2.zip cpython-c5444b355695755035d4a5cadc0467e850bb04c2.tar.gz cpython-c5444b355695755035d4a5cadc0467e850bb04c2.tar.bz2 |
Fix a bug in Generic.__new__ (GH-6758)
(cherry picked from commit b551e9f0ff25018a5606465003e2c51c04f693a3)
Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
Diffstat (limited to 'Lib/typing.py')
-rw-r--r-- | Lib/typing.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/typing.py b/Lib/typing.py index 89b73db..8025dfd 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -836,7 +836,7 @@ class Generic: if cls is Generic: raise TypeError("Type Generic cannot be instantiated; " "it can be used only as a base class") - if super().__new__ is object.__new__: + if super().__new__ is object.__new__ and cls.__init__ is not object.__init__: obj = super().__new__(cls) else: obj = super().__new__(cls, *args, **kwds) |