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

bpo-45438: format of inspect.Signature with generic builtins #29212

Merged
merged 2 commits into from
Oct 27, 2021
Merged

bpo-45438: format of inspect.Signature with generic builtins #29212

merged 2 commits into from
Oct 27, 2021

Conversation

martinitus
Copy link
Contributor

@martinitus martinitus commented Oct 25, 2021

  • Use isinstance(annotation,types.GenericAlias) in inspect.formatannotation to correctly add type arguments of builtin types to the string representation of Signatures.
  • Add test case for generic signature formatting.

https://bugs.python.org/issue45438

Use types.GenericAlias in inspect.formatannotation to correctly add
type arguments of builtin types to the string representation of
Signatures.
@the-knights-who-say-ni

This comment has been minimized.

@gvanrossum
Copy link
Member

@martinitus Please add a news entry.

@martinitus
Copy link
Contributor Author

martinitus commented Oct 27, 2021

Added news entry!

How are backports done? - Should I create separate PRs for the 3.10 and 3.9 branches where I cherry pick the two commits?

  • Also: Not sure what is with the Azure Pipeline documentation build, but it also fails with the same error on the current main on my local linux machine (make venv doc)

@gvanrossum
Copy link
Member

Let’s ignore the doc error. Backport are done by a bot. I will merge once the other tests pass.

@gvanrossum gvanrossum merged commit d02ffd1 into python:main Oct 27, 2021
@miss-islington
Copy link
Contributor

Thanks @martinitus for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10.
🐍🍒⛏🤖

@bedevere-bot
Copy link

@gvanrossum: Please replace # with GH- in the commit message next time. Thanks!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 27, 2021
…H-29212)

Use types.GenericAlias in inspect.formatannotation to correctly add
type arguments of builtin types to the string representation of
Signatures.

Co-authored-by: Martin Rückl <martin.rueckl@codecentric.de>
(cherry picked from commit d02ffd1)

Co-authored-by: Martin Rueckl <enigma@nbubu.de>
@bedevere-bot
Copy link

GH-29253 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Oct 27, 2021
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 27, 2021
…H-29212)

Use types.GenericAlias in inspect.formatannotation to correctly add
type arguments of builtin types to the string representation of
Signatures.

Co-authored-by: Martin Rückl <martin.rueckl@codecentric.de>
(cherry picked from commit d02ffd1)

Co-authored-by: Martin Rueckl <enigma@nbubu.de>
@bedevere-bot
Copy link

GH-29254 is a backport of this pull request to the 3.9 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Oct 27, 2021
miss-islington added a commit that referenced this pull request Oct 27, 2021
Use types.GenericAlias in inspect.formatannotation to correctly add
type arguments of builtin types to the string representation of
Signatures.

Co-authored-by: Martin Rückl <martin.rueckl@codecentric.de>
(cherry picked from commit d02ffd1)

Co-authored-by: Martin Rueckl <enigma@nbubu.de>
miss-islington added a commit that referenced this pull request Oct 27, 2021
Use types.GenericAlias in inspect.formatannotation to correctly add
type arguments of builtin types to the string representation of
Signatures.

Co-authored-by: Martin Rückl <martin.rueckl@codecentric.de>
(cherry picked from commit d02ffd1)

Co-authored-by: Martin Rueckl <enigma@nbubu.de>
@martinitus martinitus deleted the bpo-45438 branch November 1, 2021 10:04
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.

6 participants