Skip to content

Commit 4e2f041

Browse files
committed
Consider Type Error from python/cpython/pull/124795
1 parent c00494a commit 4e2f041

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/typing_extensions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3539,6 +3539,8 @@ def __init__(self, name: str, value, *, type_params=()):
35393539
default_value_encountered = False
35403540
parameters = []
35413541
for type_param in type_params:
3542+
if not isinstance(type_param, (TypeVar, TypeVarTuple, ParamSpec)):
3543+
raise TypeError(f"Expected a type param, got {type_param!r}")
35423544
has_default = getattr(type_param, '__default__', NoDefault) is not NoDefault
35433545
if default_value_encountered and not has_default:
35443546
raise TypeError(f'Type parameter {type_param!r} without a default'

0 commit comments

Comments
 (0)