summaryrefslogtreecommitdiffstats
path: root/Lib/typing.py
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2020-07-05 05:07:43 (GMT)
committerGitHub <noreply@github.com>2020-07-05 05:07:43 (GMT)
commit7fed75597fac11f9a6c769e2b6c6548fe0e4049d (patch)
tree0fe94b8d0df267975902c7eaa0282c223ef8fd27 /Lib/typing.py
parent9c8441712230660fedac818ed50e7cdd89e4c51d (diff)
downloadcpython-7fed75597fac11f9a6c769e2b6c6548fe0e4049d.zip
cpython-7fed75597fac11f9a6c769e2b6c6548fe0e4049d.tar.gz
cpython-7fed75597fac11f9a6c769e2b6c6548fe0e4049d.tar.bz2
bpo-39168: Remove the __new__ method of typing.Generic (GH-21327)
Automerge-Triggered-By: @gvanrossum
Diffstat (limited to 'Lib/typing.py')
-rw-r--r--Lib/typing.py10
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):