Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-105486: Change the repr of ParamSpec list of args in GenericAlias #105488

Merged
merged 4 commits into from
Jul 1, 2023

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Jun 8, 2023

Now it looks like this:

>>> type A[X, **Y] = None
>>> A[int, [str]]
A[int, [str]]

Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Lib/test/test_type_aliases.py Show resolved Hide resolved
Objects/genericaliasobject.c Outdated Show resolved Hide resolved
@sobolevn
Copy link
Member Author

Is there anything left?

@JelleZijlstra
Copy link
Member

@AlexWaygood you added the 3.12 backport label, but this feels like a feature change that should only go into main. What do you think?

Also, this PR is linked to issue #105487, but I don't see how it is related. I think this is a good change and we should merge it, but was there some other issue this should be linked to?

@JelleZijlstra
Copy link
Member

Ah it should be #105486, I'll update the PR.

@JelleZijlstra JelleZijlstra changed the title gh-105487: Change the repr of ParamSpec list of args in GenericAlias gh-105486: Change the repr of ParamSpec list of args in GenericAlias Jun 30, 2023
@AlexWaygood
Copy link
Member

@AlexWaygood you added the 3.12 backport label, but this feels like a feature change that should only go into main. What do you think?

Hmm, I view the current repr as pretty inconsistent — a latent bug that was exposed by the PEP-695 implementation. So I would favour backporting here. Given that 3.12 has yet to be released, I also think it will be less disruptive to change the repr now rather than have the repr change between 3.12 and 3.13, which could break people's doctests etc.

@JelleZijlstra
Copy link
Member

That's fair. I suppose you could technically run into this in 3.11, but PEP 695 makes it a lot easier. I'm fine with backporting.

@JelleZijlstra JelleZijlstra enabled auto-merge (squash) June 30, 2023 23:43
@JelleZijlstra JelleZijlstra merged commit eb7d6e7 into python:main Jul 1, 2023
21 checks passed
@miss-islington
Copy link
Contributor

Thanks @sobolevn for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 1, 2023
…nericAlias` (pythonGH-105488)

(cherry picked from commit eb7d6e7)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@bedevere-bot
Copy link

GH-106297 is a backport of this pull request to the 3.12 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 bug and security fixes label Jul 1, 2023
JelleZijlstra pushed a commit that referenced this pull request Jul 1, 2023
…enericAlias` (GH-105488) (#106297)

gh-105486: Change the `repr` of `ParamSpec` list of args in `GenericAlias` (GH-105488)
(cherry picked from commit eb7d6e7)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
manosriram pushed a commit to manosriram/cpython that referenced this pull request Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants