diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2020-07-05 16:02:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-05 16:02:40 (GMT) |
commit | 5a1384935ee8996a5bd240dd29f9b5e356cfc467 (patch) | |
tree | 6b5fdb2d097ae59313eeac04a74ff74fdb3c2952 /Lib/typing.py | |
parent | 16f451744b7f4653ca9db4b4bedbb6fc5c0de154 (diff) | |
download | cpython-5a1384935ee8996a5bd240dd29f9b5e356cfc467.zip cpython-5a1384935ee8996a5bd240dd29f9b5e356cfc467.tar.gz cpython-5a1384935ee8996a5bd240dd29f9b5e356cfc467.tar.bz2 |
bpo-39168: Remove the __new__ method of typing.Generic (GH-21327)
Automerge-Triggered-By: @gvanrossum
(cherry picked from commit 7fed75597fac11f9a6c769e2b6c6548fe0e4049d)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Diffstat (limited to 'Lib/typing.py')
-rw-r--r-- | Lib/typing.py | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/Lib/typing.py b/Lib/typing.py index f94996d..fd657ca 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -894,16 +894,6 @@ class Generic: __slots__ = () _is_protocol = False - def __new__(cls, *args, **kwds): - if cls in (Generic, Protocol): - raise TypeError(f"Type {cls.__name__} cannot be instantiated; " - "it can be used only as a base class") - if super().__new__ is object.__new__ and cls.__init__ is not object.__init__: - obj = super().__new__(cls) - else: - obj = super().__new__(cls, *args, **kwds) - return obj - @_tp_cache def __class_getitem__(cls, params): if not isinstance(params, tuple): |