GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-105486: Change the `repr` of `ParamSpec` list of args in `GenericAlias` by sobolevn · Pull Request #105488 · python/cpython

Conversation

@sobolevn

@sobolevn sobolevn commented Jun 8, 2023 •
edited by AlexWaygood
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Now it looks like this:

>>> type A[X, **Y] = None
>>> A[int, [str]]
A[int, [str]]
  • Issue: Inconsistent repr of types.GenericAlias with ParamSpec #105486

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sobolevn
pythongh-105487: Change the repr of ParamSpec list of args in `Ge…
3402de9
…nericAlias`
@sobolevn
sobolevn requested a review from JelleZijlstra as a code owner June 8, 2023 06:11
@bedevere-bot bedevere-bot added the awaiting review label Jun 8, 2023
@bedevere-bot bedevere-bot mentioned this pull request Jun 8, 2023
types.GenericAlias has extra __copy__ and __deepcopy__ in __dir__ #105487
Closed
@AlexWaygood AlexWaygood added the needs backport to 3.12 only security fixes label Jun 8, 2023
JelleZijlstra
JelleZijlstra reviewed Jun 8, 2023
View reviewed changes

@JelleZijlstra JelleZijlstra left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/test/test_type_aliases.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Objects/genericaliasobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

sobolevn added 2 commits June 8, 2023 19:35
@sobolevn
Address review
7bc1707
@sobolevn
Add repr test
4de2f6f
@sobolevn
sobolevn requested a review from JelleZijlstra June 27, 2023 07:40
@sobolevn

sobolevn commented Jun 27, 2023

Copy link
Copy Markdown
Member Author

Is there anything left?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JelleZijlstra
JelleZijlstra approved these changes Jun 30, 2023
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels Jun 30, 2023
@JelleZijlstra

JelleZijlstra commented Jun 30, 2023

Copy link
Copy Markdown
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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JelleZijlstra

JelleZijlstra commented Jun 30, 2023

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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
@bedevere-bot bedevere-bot mentioned this pull request Jun 8, 2023
Inconsistent repr of types.GenericAlias with ParamSpec #105486
Closed
@JelleZijlstra
Rename NEWS file
e2a3d9c
@AlexWaygood

AlexWaygood commented Jun 30, 2023

Copy link
Copy Markdown
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JelleZijlstra

JelleZijlstra commented Jun 30, 2023

Copy link
Copy Markdown
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.

AlexWaygood reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

miss-islington commented Jul 1, 2023

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the awaiting merge label Jul 1, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 1, 2023
@sobolevn @miss-islington
pythongh-105486: Change the repr of ParamSpec list of args in `Ge…
9d46011
…nericAlias` (pythonGH-105488)

(cherry picked from commit eb7d6e7)

Co-authored-by: Nikita Sobolev <[email protected]>
@bedevere-bot

bedevere-bot commented Jul 1, 2023

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label Jul 1, 2023
JelleZijlstra pushed a commit that referenced this pull request Jul 1, 2023
@miss-islington @sobolevn
[3.12] gh-105486: Change the repr of ParamSpec list of args in `G…
c4298d5
…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 <[email protected]>
manosriram pushed a commit to manosriram/cpython that referenced this pull request Jul 1, 2023
@sobolevn @manosriram
pythongh-105486: Change the repr of ParamSpec list of args in `Ge…
a866b07
…nericAlias` (python#105488)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JelleZijlstra JelleZijlstra JelleZijlstra approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@sobolevn @JelleZijlstra @AlexWaygood @miss-islington @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.