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

Add missing apostrophe to error message that's present cpython main #495

Merged
merged 24 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
507088c
type_params must be a tuple
Daraan Sep 30, 2024
c00494a
no non default value after default value
Daraan Sep 30, 2024
4e2f041
Consider Type Error from python/cpython/pull/124795
Daraan Sep 30, 2024
b2412b0
Adjusted error messages to match cpython
Daraan Oct 1, 2024
54a67ab
updated changelog
Daraan Oct 1, 2024
64e4007
Removed invalid tests and left comment
Daraan Oct 1, 2024
dccb363
Slight modification of tests
Daraan Oct 1, 2024
4edee59
fix indent
Daraan Oct 1, 2024
c928b20
Corrected 3.12.8 requirement
Daraan Oct 1, 2024
9ad28aa
Merge 'main' into TypeAliasType/invalid_param_spec
Daraan Oct 11, 2024
4b9a04c
Updated barrier to skip 3.12-3.13
Daraan Oct 11, 2024
6ba3f5e
Merge branch 'main' into TypeAliasType/invalid_param_spec
JelleZijlstra Oct 21, 2024
e729c1f
Split compatibility checks into more methods
Daraan Oct 21, 2024
83bbb98
Merge remote-tracking branch 'upstream/main' into TypeAliasType/inval…
Daraan Oct 21, 2024
ae88d98
Merge remote-tracking branch 'origin/TypeAliasType/invalid_param_spec…
Daraan Oct 21, 2024
6bc5c46
Merge remote-tracking branch 'upstream/main' into TypeAliasType/inval…
Daraan Oct 22, 2024
94b8c86
Draft for 3.12, 3.13 backport
Daraan Oct 22, 2024
46ab3ac
Use TypeAliasType backport for <3.14
Daraan Oct 22, 2024
b38852e
fix typo and style
Daraan Oct 22, 2024
1ef3e00
Unpack should not pass as a TypeVar
Daraan Oct 22, 2024
cdf7fec
Clarified statement about Unpack for < 3.12
Daraan Oct 23, 2024
c14567d
Updated unpack comment in main code
Daraan Oct 23, 2024
ff14de8
Merge remote-tracking branch 'upstream/main' into TypeAliasType/inval…
Daraan Oct 25, 2024
bb5ea7d
Fix typo with 3.14 comparision
Daraan Oct 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/test_typing_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7463,9 +7463,9 @@ def test_type_params_possibilities(self):
(T_default, P_default, Ts_default),
]
invalid_cases = [
((T_default, T), f"non-default type parameter {T!r} follows default"),
((P_default, P), f"non-default type parameter {P!r} follows default"),
((Ts_default, T), f"non-default type parameter {T!r} follows default"),
((T_default, T), f"non-default type parameter '{T!r}' follows default"),
((P_default, P), f"non-default type parameter '{P!r}' follows default"),
((Ts_default, T), f"non-default type parameter '{T!r}' follows default"),
# Only type params are accepted
((1,), "Expected a type param, got 1"),
((str,), f"Expected a type param, got {str!r}"),
Expand Down
4 changes: 2 additions & 2 deletions src/typing_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3622,8 +3622,8 @@ def __init__(self, name: str, value, *, type_params=()):
getattr(type_param, '__default__', NoDefault) is not NoDefault
)
if default_value_encountered and not has_default:
raise TypeError(f'non-default type parameter {type_param!r}'
' follows default type parameter')
raise TypeError(f"non-default type parameter '{type_param!r}'"
" follows default type parameter")
if has_default:
default_value_encountered = True
if isinstance(type_param, TypeVarTuple):
Expand Down
Loading