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 — bpo-42195: Override _CallableGenericAlias's __getitem__ by Fidget-Spinner · Pull Request #23915 · python/cpython

Conversation

@Fidget-Spinner

@Fidget-Spinner Fidget-Spinner commented Dec 24, 2020 •
edited by miss-islington
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Added __getitem__ for _CallableGenericAlias so that it returns a subclass (itself) of types.GenericAlias rather than the default behavior of returning a plain types.GenericAlias. This fixes repr issues occuring after TypeVar substitution arising from the previous behavior.

https://bugs.python.org/issue42195

Automerge-Triggered-By: GH:gvanrossum

Sorry, something went wrong.

Uh oh!

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

All reactions
@Fidget-Spinner
Fix callable genericalias __getitem__
9760372
@Fidget-Spinner
Fidget-Spinner requested a review from rhettinger as a code owner December 24, 2020 01:34
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Dec 24, 2020
@bedevere-bot bedevere-bot added the awaiting review label Dec 24, 2020
@Fidget-Spinner

Fidget-Spinner commented Dec 24, 2020

Copy link
Copy Markdown
Member Author

I think we can skip news, it can share the same news item as the original PR.

All reactions

Sorry, something went wrong.

Uh oh!

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

@Fidget-Spinner Fidget-Spinner mentioned this pull request Dec 24, 2020
bpo-41559: Implement PEP 612 - Add ParamSpec and Concatenate to typing #23702
Merged
16 tasks done
gvanrossum
gvanrossum approved these changes Dec 24, 2020
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels Dec 24, 2020
@gvanrossum gvanrossum added needs backport to 3.9 skip news labels Dec 24, 2020
@miss-islington
miss-islington merged commit 6dd3da3 into python:master Dec 24, 2020
@miss-islington

miss-islington commented Dec 24, 2020

Copy link
Copy Markdown
Contributor

Thanks @Fidget-Spinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

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 Dec 24, 2020
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 24, 2020
@Fidget-Spinner @miss-islington
bpo-42195: Override _CallableGenericAlias's __getitem__ (pythonGH-23915)
aa66f22
Added `__getitem__` for `_CallableGenericAlias` so that it returns a subclass (itself) of `types.GenericAlias` rather than the default behavior of returning a plain `types.GenericAlias`. This fixes `repr` issues occuring after `TypeVar` substitution arising from the previous behavior.
(cherry picked from commit 6dd3da3)

Co-authored-by: kj <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.9 label Dec 24, 2020
@bedevere-bot

bedevere-bot commented Dec 24, 2020

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

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

miss-islington added a commit that referenced this pull request Dec 24, 2020
@miss-islington @Fidget-Spinner
bpo-42195: Override _CallableGenericAlias's __getitem__ (GH-23915)
a125198
Added `__getitem__` for `_CallableGenericAlias` so that it returns a subclass (itself) of `types.GenericAlias` rather than the default behavior of returning a plain `types.GenericAlias`. This fixes `repr` issues occuring after `TypeVar` substitution arising from the previous behavior.
(cherry picked from commit 6dd3da3)

Co-authored-by: kj <[email protected]>
@Fidget-Spinner
Fidget-Spinner deleted the getitem-callable branch December 24, 2020 04:26
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
@Fidget-Spinner @adorilson
bpo-42195: Override _CallableGenericAlias's __getitem__ (pythonGH-23915)
01c00fa
Added `__getitem__` for `_CallableGenericAlias` so that it returns a subclass (itself) of `types.GenericAlias` rather than the default behavior of returning a plain `types.GenericAlias`. This fixes `repr` issues occuring after `TypeVar` substitution arising from the previous behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gvanrossum gvanrossum gvanrossum approved these changes
@rhettinger rhettinger Awaiting requested review from rhettinger

Uh oh!

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

Assignees

No one assigned

Labels

skip news

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

@Fidget-Spinner @miss-islington @bedevere-bot @gvanrossum @the-knights-who-say-ni
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.