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: Support substitution of TypeVar with an unpacked variable-size tuple by serhiy-storchaka · Pull Request #93330 · python/cpython

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented May 29, 2022 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

For example:

A[T, *Ts][*tuple[int, ...]] -> A[int, *tuple[int, ...]]
A[*Ts, T][*tuple[int, ...]] -> A[*tuple[int, ...], int]

#91162

Sorry, something went wrong.

Uh oh!

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

All reactions
@serhiy-storchaka
pythongh-91162: Support substitution of TypeVar with an unpacked vari…
cfb43b2
…able-size tuple

For example:

  A[T, *Ts][*tuple[int, ...]] -> A[int, *tuple[int, ...]]
  A[*Ts, T][*tuple[int, ...]] -> A[*tuple[int, ...], int]
@serhiy-storchaka serhiy-storchaka added type-feature A feature request or enhancement needs backport to 3.11 only security fixes labels May 29, 2022
@bedevere-bot bedevere-bot added the awaiting core review label May 29, 2022
@serhiy-storchaka serhiy-storchaka changed the title gh-91162: Support substitution of TypeVar with an unpacked variable-size tuple [WIP] gh-91162: Support substitution of TypeVar with an unpacked variable-size tuple May 29, 2022
@mrahtz mrahtz mentioned this pull request May 29, 2022
gh-91162: Implement splitting of *tuple[int, ...] over T, *Ts in typing.py #93318
Closed
serhiy-storchaka added 2 commits May 29, 2022 19:01
@serhiy-storchaka
The C implementation.
c638e0e
@serhiy-storchaka
Remove unused code.
731d5fb
@serhiy-storchaka serhiy-storchaka changed the title [WIP] gh-91162: Support substitution of TypeVar with an unpacked variable-size tuple gh-91162: Support substitution of TypeVar with an unpacked variable-size tuple May 29, 2022
@serhiy-storchaka
serhiy-storchaka marked this pull request as ready for review May 29, 2022 18:49
@serhiy-storchaka
serhiy-storchaka requested review from Fidget-Spinner, JelleZijlstra and gvanrossum as code owners May 29, 2022 18:49
@serhiy-storchaka
Refactoring.
03da794
This was referenced May 30, 2022
PEP 646: Decide on substitution behavior #91162
Closed
Crash in substitution of nested TypeVar after TypeVarTuple #93345
Closed
serhiy-storchaka added 3 commits May 31, 2022 08:50
@serhiy-storchaka
Merge branch 'main' into typing-subst-unpacked-vat-tuple
b497df5
@serhiy-storchaka
Add a NEWS entry.
55c4efb
@serhiy-storchaka
Merge branch 'main' into typing-subst-unpacked-vat-tuple
7dcf277
@serhiy-storchaka serhiy-storchaka mentioned this pull request Jun 1, 2022
gh-91162: Support splitting of unpacked arbitrary-length tuple over TypeVar and TypeVarTuple parameters (alt) #93412
Merged
@JelleZijlstra
Merge branch 'main' into typing-subst-unpacked-vat-tuple
56f02d8
JelleZijlstra
JelleZijlstra approved these changes Jun 4, 2022
View reviewed changes
Comment thread Objects/genericaliasobject.c
if (arg) {
if (vartuplearg < nitems) {
Py_DECREF(arg);
Py_DECREF(fillarg);

@JelleZijlstra JelleZijlstra Jun 4, 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.

This could use an assert(fillarg) to make sure it's not NULL.

Sorry, something went wrong.

Uh oh!

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

All reactions

@serhiy-storchaka serhiy-storchaka Jun 4, 2022

Copy link
Copy Markdown
Member Author

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.

Py_DECREF() makes sure that the argument is not NULL. The result is the same -- a crash.

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Jun 4, 2022
@serhiy-storchaka

serhiy-storchaka commented Jun 4, 2022

Copy link
Copy Markdown
Member Author

See also #93412.

All reactions

Sorry, something went wrong.

Uh oh!

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

serhiy-storchaka added 2 commits June 5, 2022 11:26
@serhiy-storchaka
Merge branch 'main' into typing-subst-unpacked-vat-tuple
b091d97
@serhiy-storchaka
Merge remote-tracking branch 'origin/typing-subst-unpacked-vat-tuple'…
40ba6ca
… into typing-subst-unpacked-vat-tuple
@serhiy-storchaka serhiy-storchaka closed this Jun 12, 2022
@serhiy-storchaka
serhiy-storchaka deleted the typing-subst-unpacked-vat-tuple branch June 12, 2022 13:22
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
@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 merge needs backport to 3.11 only security fixes type-feature A feature request or enhancement

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

@serhiy-storchaka @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.