Replies: 1 comment 2 replies
-
I don't think PEP 612 technically allows using ellipsis in this context. 3.11 will allow some similar things at runtime (python/cpython@81120b6), but it's still not a well-specified area. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
I have two code examples using mixes of ParamSpec, Unions, and Ellipsis causing runtime errors.
Failing code examples
Stringified ellipsis in generic union
This could be fixed by stringifying the whole thing (
'Alias[..., object]'
).Getting typehints of stringified ellipsis in generic
In the same vein as the above (but stemming from a difference place), if you try to get the type hints of a normal generic with a stringified ellipsis in the place of the ParamSpec you get an error:
My only question is whether I am doing something wrong? The reason for this stringifying is compatibility but I am starting to run out of options with these issues.
Beta Was this translation helpful? Give feedback.
All reactions