Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions src/test_typing_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5984,7 +5984,7 @@ class ProtoZ(Protocol[P]):
G9 = klass[Concatenate[T, P_2]]
self.assertEqual(G9.__args__, (Concatenate[T, P_2], ))

# This is an invalid form but useful for testing correct subsitution
# This is an invalid form but useful for testing correct substitution
G10 = klass[int, Concatenate[str, P]]
G10args = G10.__args__[0] if sys.version_info >= (3, 10) else G10.__args__
self.assertEqual(G10args, (int, Concatenate[str, P], ))
Expand Down Expand Up @@ -6049,7 +6049,7 @@ class ProtoZ(Protocol[P]):
H9 = G9[int, [T]]
self.assertEqual(H9.__parameters__, (T,))

# This is an invalid parameter expression but useful for testing correct subsitution
# This is an invalid parameter expression but useful for testing correct substitution
G10 = klass[int, Concatenate[str, P]]
with self.subTest("Check invalid form substitution"):
self.assertEqual(G10.__parameters__, (P, ))
Expand Down
2 changes: 1 addition & 1 deletion src/typing_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1635,7 +1635,7 @@ def _clean_optional(obj, hints, globalns=None, localns=None):
return
original_hints = obj.__annotations__
for name, value in hints.items():
# Not a Union[..., None] or replacement conditions not fullfilled
# Not a Union[..., None] or replacement conditions not fulfilled
if (not _could_be_inserted_optional(value)
or name not in defaults
or defaults[name] is not None
Expand Down
Loading