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-91162: Disallow tuple[T][*anything] by mrahtz · Pull Request #92255 · python/cpython

Conversation

@mrahtz

@mrahtz mrahtz commented May 3, 2022

Copy link
Copy Markdown
Contributor

We agreed in #91162 that unpacked type arguments should only be valid to generic aliases that can accept a variable number of arguments - that is, unpacked type arguments should only be valid to generic aliases with a TypeVarTuple in the type parameters.

@JelleZijlstra Could I ask you for review on this?

(This PR is based on #92249, so there are a couple of extra commits. See the latest commit for the one that's actually part of this PR. I think I should be able to effectively hide the changes from the extra commits once #92249 is merged - so we can start review on this PR now?)

Sorry, something went wrong.

Uh oh!

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

JelleZijlstra reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
mrahtz added 3 commits May 3, 2022 19:29
@mrahtz
Fix starred tuple equality and pickling
335747d
@mrahtz
Update test comment
5d384b9
@mrahtz
Disallow tuple[T][*anything]
feba81b
@mrahtz
mrahtz requested review from Fidget-Spinner, JelleZijlstra and gvanrossum as code owners May 3, 2022 19:08
@bedevere-bot bedevere-bot added the awaiting review label May 3, 2022
@mrahtz

mrahtz commented May 3, 2022

Copy link
Copy Markdown
Contributor Author

Oops, sorry - while implementing another PR, I realised this is probably going to conflict with something else we'll need to do in typing.py. Closing for now.

All reactions

Sorry, something went wrong.

Uh oh!

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

@mrahtz mrahtz closed this May 3, 2022
JelleZijlstra
JelleZijlstra reviewed May 3, 2022
View reviewed changes
Comment thread Lib/test/test_typing.py
complexity to typing.py). This spec is currently being discussed at
https://github.com/python/cpython/issues/91162.
Note that not all the rules governing substitution behavior at runtime
is codified in PEPs; the source of truth for these tests is the tests

@JelleZijlstra JelleZijlstra May 3, 2022

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.

Suggested change
is codified in PEPs; the source of truth for these tests is the tests
are codified in PEPs; the source of truth for these tests is the tests

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Lib/typing.py
return f'ForwardRef({self.__forward_arg__!r}{module_repr})'


def _is_unpacked_type(x: Any) -> bool:

@JelleZijlstra JelleZijlstra May 3, 2022

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.

Suggested change
def _is_unpacked_type(x: Any) -> bool:
def _is_unpacked_type(x: object) -> bool:

Sorry, something went wrong.

Uh oh!

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

All reactions
@mrahtz

mrahtz commented May 3, 2022

Copy link
Copy Markdown
Contributor Author

Thanks for the quick review anyway Jelle :) I'll integrate those suggestions in the upcoming PR.

JelleZijlstra 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.

@mrahtz
mrahtz deleted the subst-fixes-1 branch May 8, 2022 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JelleZijlstra JelleZijlstra JelleZijlstra left review comments
@gvanrossum gvanrossum Awaiting requested review from gvanrossum
@Fidget-Spinner Fidget-Spinner Awaiting requested review from Fidget-Spinner

Uh oh!

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

Assignees

No one assigned

Labels

awaiting review

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.

3 participants

@mrahtz @JelleZijlstra @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.