Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ParamSpec ellipsis default for <3.10 #279

Merged
merged 6 commits into from
Sep 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/typing_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,10 @@ def _set_default(type_param, default):
type_param.__default__ = tuple((typing._type_check(d, "Default must be a type")
for d in default))
elif default != _marker:
type_param.__default__ = typing._type_check(default, "Default must be a type")
if isinstance(type_param, ParamSpec) and default is ...: # ellipsis wasn't accepted until 3.11 as a valid call
type_param.__default__ = default
else:
type_param.__default__ = typing._type_check(default, "Default must be a type")
else:
type_param.__default__ = None

Expand Down