Added support for Concatenate with Ellipsis
Fixes #110 for Python 3.9-3.10:
An Ellipsis cannot be used with Concatenate as last parameter must be a ParamSpec in Python 3.11 this is allowed, Python 3.10 does not support this.
Does not fix:
- #48 : Using Ellipsis as argument for Callable with a generic..
- <= 3.9: because of
typing.Callablelimitations - For 3.10 could go back to
typing_extentions._ConcatenateGenericAliasbut also tricky.
- <= 3.9: because of
- #110 for Python 3.8 as this is caused by
typing.Callableas it does only accepts args that are types, i.e.Ellipsisis not supported.
Changes:
- Changed
_concatenate_getitemto reflect the Python3.11 typing module that allows the Ellipsis parameter. - For Python 3.10 uses
typing._ConcatenateGenericAliasand an alternate_concatenate_getitem - For <=Python 3.9 the
typing_extensions._ConcatenateGenericAliasand_concatenate_getitemlike before - Added tests
Python Versions:
- 3.8 not fixable, ok but skipped tests.
- 3.9 ok
- 3.9.0 ok (locally)
- 3.10 ok
- 3.10.0 ok (locally)
- 3.11 ok - no backport. One new test for #48 that only runs on 3.11+
EDIT: Accounted for changes in Python. 3.9.2 and ~3.10.2, Tests for 3.*.0 should work now.
I've made a rework (moved the parts to _create_concatenate_alias) that is now simpler and also works for Python 3.8 and fully solves #110 on the current version range.
Looks like you might have closed this accidentally. Probably this is something to do with the fact that it was a PR from your fork's main branch. I think it's unfortunately impossible to repair PRs when they get to this state — do you want to recreate the PR using a different branch on your fork? :-)
Thanks for your kind reply. Yep I've just butchered this 🙈, I am sorry. It's as you assume related to the fork from main ...
We've all been there, pretty sure I've done it at least once :-)