FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-91162: Support substitution of TypeVar with an unpacked variable-size tuple by serhiy-storchaka · Pull Request #93330 · python/cpython · GitHub

/ cpython Public

gh-91162: Support substitution of TypeVar with an unpacked variable-size tuple - #93330

Closed
serhiy-storchaka wants to merge 10 commits into
python:mainfrom
serhiy-storchaka:typing-subst-unpacked-vat-tuple
Closed

gh-91162: Support substitution of TypeVar with an unpacked variable-size tuple#93330
serhiy-storchaka wants to merge 10 commits into
python:mainfrom
serhiy-storchaka:typing-subst-unpacked-vat-tuple

Conversation

serhiy-storchaka commented May 29, 2022
edited
Loading

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

…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 added type-feature A feature request or enhancement needs backport to 3.11 only security fixes labels May 29, 2022
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
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 marked this pull request as ready for review May 29, 2022 18:49
if (arg) {
if (vartuplearg < nitems) {
Py_DECREF(arg);
Py_DECREF(fillarg);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Copy link
Copy Markdown
Member Author

See also #93412.

serhiy-storchaka deleted the typing-subst-unpacked-vat-tuple branch June 12, 2022 13:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge needs backport to 3.11 only security fixes type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL