8000 fix Generic · python/cpython@fe84458 · GitHub
[go: up one dir, main page]

Skip to content

Commit fe84458

Browse files
committed
fix Generic
1 parent a7e6bcb commit fe84458

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Lib/typing.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1899,16 +1899,17 @@ def _proto_hook(other):
18991899
if cls.__init__ is Protocol.__init__:
19001900
cls.__init__ = _no_init_or_replace_init
19011901

1902-
def _dummy[T, *Ts, **P]():
1902+
class _Dummy[T, *Ts, **P]():
19031903
pass
19041904

1905-
TypeVar = type(_dummy.__type_variables__[0])
1906-
TypeVarTuple = type(_dummy.__type_variables__[1])
1907-
ParamSpec = type(_dummy.__type_variables__[2])
1905+
TypeVar = type(_Dummy.__type_variables__[0])
1906+
TypeVarTuple = type(_Dummy.__type_variables__[1])
1907+
ParamSpec = type(_Dummy.__type_variables__[2])
19081908
ParamSpecArgs = type(ParamSpec("P").args)
19091909
ParamSpecKwargs = type(ParamSpec("P").kwargs)
1910+
Generic = _Dummy.__mro__[1]
19101911

1911-
del _dummy
1912+
del _Dummy
19121913

19131914
def _pickle_psargs(psargs):
19141915
return ParamSpecArgs, (psargs.__origin__,)

0 commit comments

Comments
 (0)
0