python / typing_extensions

Backported and experimental type hints for Python
Other
446 stars 110 forks source link

Support subscription of `Callable[Concatenate[P], Any]` with `...` in Python 3.10 #479

Closed Daraan closed 1 month ago

Daraan commented 1 month ago

Fixes https://github.com/python/typing_extensions/issues/48 for python 3.10.3+

The first versions 3.10.0 - 3.10.2 did not enforce restrictions on the last parameter of _ConcatenateGenericAlias. 3.10.3-3.10.* only support ParamSpec, i.e. no Ellipsis, hence https://github.com/python/typing_extensions/issues/48 also holds for these versions.

This PR adds a backport of _ConcatenateGenericAlias which overrrides the problematic copy_with method.


JelleZijlstra commented 1 month ago

New changes require approval from someone other than JelleZijlstra because they were the last pusher

That'll teach me to fix merge conflicts, I guess.

AlexWaygood commented 1 month ago

I am now blocked from merging, tossing it back to you @JelleZijlstra