Skip to content

Commit f2c2540

Browse files
committed
TypeAliasType.__type_params__ can return forms from typing_extensions
1 parent bc49fc5 commit f2c2540

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

stdlib/typing.pyi

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,15 @@ if sys.version_info >= (3, 10):
11331133
def _type_repr(obj: object) -> str: ...
11341134

11351135
if sys.version_info >= (3, 12):
1136+
_TypeVariable: TypeAlias = (
1137+
TypeVar
1138+
| typing_extensions.TypeVar
1139+
| ParamSpec
1140+
| typing_extensions.ParamSpec
1141+
| TypeVarTuple
1142+
| typing_extensions.TypeVarTuple
1143+
)
1144+
11361145
def override(method: _F, /) -> _F: ...
11371146
@final
11381147
class TypeAliasType:
@@ -1141,20 +1150,12 @@ if sys.version_info >= (3, 12):
11411150
name: str,
11421151
value: Any,
11431152
*,
1144-
type_params: tuple[
1145-
TypeVar
1146-
| typing_extensions.TypeVar
1147-
| ParamSpec
1148-
| typing_extensions.ParamSpec
1149-
| TypeVarTuple
1150-
| typing_extensions.TypeVarTuple,
1151-
...,
1152-
] = (),
1153+
type_params: tuple[_TypeVariable, ...] = (),
11531154
) -> Self: ...
11541155
@property
11551156
def __value__(self) -> Any: ... # AnnotationForm
11561157
@property
1157-
def __type_params__(self) -> tuple[TypeVar | ParamSpec | TypeVarTuple, ...]: ...
1158+
def __type_params__(self) -> tuple[_TypeVariable, ...]: ...
11581159
@property
11591160
def __parameters__(self) -> tuple[Any, ...]: ... # AnnotationForm
11601161
@property

0 commit comments

Comments
 (0)