Uh oh!
There was an error while loading. Please reload this page.
gh-88965: Fix type substitution of a list of types after initial ParamSpec substitution - #102808
Conversation
…l `ParamSpec` substitution
sobolevn
commented
Mar 18, 2023
@AlexWaygood you might be interested, since you've originally asked to take a look :) |
AlexWaygood
left a comment
There was a problem hiding this comment.
I think this is the correct solution -- thanks so much for taking a look at this! I have a couple of points about code readability, and a suggestion about the tests:
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
sobolevn
commented
Mar 22, 2023
@AlexWaygood friendly ping :) |
AlexWaygood
commented
Mar 22, 2023
I haven't forgotten! It's only been two days 😄 |
sobolevn
commented
Mar 22, 2023
Oh wow, the time is a very strange thing! |
AlexWaygood
left a comment
There was a problem hiding this comment.
Looks great to me. I have some ideas about how to clean up the tuple special-casing, but I think that should wait for another PR, as it might not be so backportable.
Uh oh!
There was an error while loading. Please reload this page.
miss-islington
commented
Mar 23, 2023
Thanks @sobolevn for the PR, and @AlexWaygood for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
miss-islington
commented
Mar 23, 2023
Sorry @sobolevn and @AlexWaygood, I had trouble checking out the |
miss-islington
commented
Mar 23, 2023
Sorry, @sobolevn and @AlexWaygood, I could not cleanly backport this to |
miss-islington
commented
Mar 23, 2023
Thanks @sobolevn for the PR, and @AlexWaygood for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
miss-islington
commented
Mar 23, 2023
Sorry @sobolevn and @AlexWaygood, I had trouble checking out the |
miss-islington
commented
Mar 23, 2023
Thanks @sobolevn for the PR, and @AlexWaygood for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
…r initial `ParamSpec` substitution (pythonGH-102808) Previously, this used to fail: ```py from typing import * T = TypeVar("T") P = ParamSpec("P") class X(Generic[P]): f: Callable[P, int] Y = X[[int, T]] Z = Y[str] ``` (cherry picked from commit adb0621) Co-authored-by: Nikita Sobolev <mail@sobolevn.me> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
bedevere-bot
commented
Mar 23, 2023
GH-102957 is a backport of this pull request to the 3.11 branch. |
I think backporting this might be quite complex, due to the fact that If you'd like to give it a stab @sobolevn, I'll happily review a backport PR -- but I'm also happy to just leave it unfixed on 3.10. |
gvanrossum
commented
Mar 23, 2023
Let’s leave 3.10 alone. |
sobolevn
commented
Mar 23, 2023
Ok, I won't bother then. Thanks everyone! 👍 |
…ial `ParamSpec` substitution (GH-102808) Previously, this used to fail: ```py from typing import * T = TypeVar("T") P = ParamSpec("P") class X(Generic[P]): f: Callable[P, int] Y = X[[int, T]] Z = Y[str] ``` (cherry picked from commit adb0621) Co-authored-by: Nikita Sobolev <mail@sobolevn.me> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@AlexWaygood btw, do you have any ideas of issues I can work on? I am out of my backlog :( |
AlexWaygood
commented
Mar 24, 2023
I have one in the back of my head that I'll try to write up today ;) |
…r initial `ParamSpec` substitution (python#102808) Previously, this used to fail: ```py from typing import * T = TypeVar("T") P = ParamSpec("P") class X(Generic[P]): f: Callable[P, int] Y = X[[int, T]] Z = Y[str] ``` Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
…r initial `ParamSpec` substitution (python#102808) Previously, this used to fail: ```py from typing import * T = TypeVar("T") P = ParamSpec("P") class X(Generic[P]): f: Callable[P, int] Y = X[[int, T]] Z = Y[str] ``` Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
I've tried to make tests as complete as I can imagine. But, extra cases and suggestions are welcome! ;)
This change has two parts: