Skip to content

Commit c5229f8

Browse files
committed
Minor changes
- Move changelog entry up - code style
1 parent 4e8ef02 commit c5229f8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
- Backport to Python 3.10 the ability to substitute `...` in generic `Callable`
2020
aliases that have a `Concatenate` special form as their argument.
2121
Patch by [Daraan](https://github.com/Daraan).
22-
- Fix error in subscription of `Unpack` aliases causing nested Unpacks
23-
to not be resolved correctly. Patch by [Daraan](https://github.com/Daraan).
2422
- Extended the `Concatenate` backport for Python 3.8-3.10 to now accept
2523
`Ellipsis` as an argument. Patch by [Daraan](https://github.com/Daraan).
24+
- Fix error in subscription of `Unpack` aliases causing nested Unpacks
25+
to not be resolved correctly. Patch by [Daraan](https://github.com/Daraan).
2626

2727
# Release 4.12.2 (June 7, 2024)
2828

src/typing_extensions.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,7 +1803,6 @@ def __parameters__(self):
18031803
if sys.version_info < (3, 11):
18041804
_typing_ConcatenateGenericAlias = _ConcatenateGenericAlias
18051805

1806-
18071806
class _ConcatenateGenericAlias(_typing_ConcatenateGenericAlias, _root=True):
18081807
# needed for checks in collections.abc.Callable to accept this class
18091808
__module__ = "typing"
@@ -1822,11 +1821,12 @@ def copy_with(self, params):
18221821
# 3.8-3.9.2
18231822
class _EllipsisDummy: ...
18241823

1824+
18251825
# 3.8-3.10
18261826
def _create_concatenate_alias(origin, parameters):
18271827
if parameters[-1] is ... and sys.version_info < (3, 9, 2):
18281828
# Hack: Arguments must be types, replace it with one.
1829-
parameters = parameters[:-1] + (_EllipsisDummy,)
1829+
parameters = (*parameters[:-1], _EllipsisDummy)
18301830
if sys.version_info >= (3, 10, 2):
18311831
concatenate = _ConcatenateGenericAlias(origin, parameters,
18321832
_typevar_types=(TypeVar, ParamSpec),
@@ -1861,6 +1861,7 @@ def _concatenate_getitem(self, parameters):
18611861
parameters[-1])
18621862
return _create_concatenate_alias(self, parameters)
18631863

1864+
18641865
# 3.11+; Concatenate does not accept ellipsis in 3.10
18651866
if sys.version_info >= (3, 11):
18661867
Concatenate = typing.Concatenate

0 commit comments

Comments
 (0)