Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4e2f041

Browse filesBrowse files
committed
Consider Type Error from python/cpython/pull/124795
1 parent c00494a commit 4e2f041
Copy full SHA for 4e2f041

File tree

1 file changed

+2
-0
lines changed
Filter options

1 file changed

+2
-0
lines changed

‎src/typing_extensions.py

Copy file name to clipboardExpand all lines: src/typing_extensions.py
+2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.