Uh oh!
There was an error while loading. Please reload this page.
bpo-44791: Fix substitution of ParamSpec in Concatenate with differen… - #27518
Conversation
…t parameter expressions
This PR is stale because it has been open for 30 days with no activity. |
Sorry, I'd forgotten about this. Last I recall we need to amend PEP 612 right? Serhiy would you like me to try write an initial draft (and then you can review it?). |
serhiy-storchaka
commented
Aug 31, 2021
Sure. What should be clarified: ParamSpec variables and TypeVar variables are exposed in |
| self.assertEqual(C[int, P2], Concatenate[int, P2]) | ||
| self.assertEqual(C[int, [str, float]], (int, str, float)) | ||
| self.assertEqual(C[int, []], (int,)) | ||
| self.assertEqual(C[int, ...], Concatenate[int, ...]) |
There was a problem hiding this comment.
I am not sure about this. It can be just [int, ...], although it would create a discrepancy with using ellipsis in Tuple.
miss-islington
commented
Jan 27, 2022
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
…t parameter expressions (pythonGH-27518) * Substitution with a list of types returns now a tuple of types. * Substitution with Concatenate returns now a Concatenate with concatenated lists of arguments. * Substitution with Ellipsis is not supported. (cherry picked from commit ecfacc3) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
bedevere-bot
commented
Jan 27, 2022
GH-30959 is a backport of this pull request to the 3.10 branch. |
…t parameter expressions (GH-27518) * Substitution with a list of types returns now a tuple of types. * Substitution with Concatenate returns now a Concatenate with concatenated lists of arguments. * Substitution with Ellipsis is not supported. (cherry picked from commit ecfacc3) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gvanrossum
commented
Jan 27, 2022
Should this be backported? |
serhiy-storchaka
commented
Jan 27, 2022
This PR fixes substitution of a ParamSpec variable with a Concatenate or a list of types. It is not specified by PEP 612, but does not conflict with it. Substitution with an ellipsis is now an error, because the result cannot be expressed without changing PEP 612. I have opened #30969 for supporting ellipsis. |
…t parameter expressions
https://bugs.python.org/issue44791