Skip to content

gh-124498: Fix TypeAliasType not to be generic, when type_params=() #124499

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

Merged
merged 2 commits into from
Sep 26, 2024

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Sep 25, 2024

@@ -1914,7 +1914,16 @@ typealias_alloc(PyObject *name, PyObject *type_params, PyObject *compute_value,
return NULL;
}
ta->name = Py_NewRef(name);
ta->type_params = Py_IsNone(type_params) ? NULL : Py_XNewRef(type_params);
if (
type_params == NULL
Copy link
Member

Choose a reason for hiding this comment

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

Can it ever be NULL? Can't hurt to have this check though.

Copy link
Member Author

Choose a reason for hiding this comment

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

Old code assumed this path with Py_XNewRef, so I just followed the same style.

@sobolevn sobolevn added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Sep 26, 2024
@sobolevn sobolevn merged commit abe5f79 into python:main Sep 26, 2024
41 checks passed
@miss-islington-app
Copy link

Thanks @sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 26, 2024
…rams=()` (pythonGH-124499)

(cherry picked from commit abe5f79)

Co-authored-by: sobolevn <mail@sobolevn.me>
@bedevere-app
Copy link

bedevere-app bot commented Sep 26, 2024

GH-124603 is a backport of this pull request to the 3.13 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 26, 2024
…rams=()` (pythonGH-124499)

(cherry picked from commit abe5f79)

Co-authored-by: sobolevn <mail@sobolevn.me>
@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Sep 26, 2024
@bedevere-app
Copy link

bedevere-app bot commented Sep 26, 2024

GH-124604 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Sep 26, 2024
sobolevn added a commit that referenced this pull request Sep 26, 2024
…arams=()` (GH-124499) (#124604)

gh-124498: Fix `TypeAliasType` not to be generic, when `type_params=()` (GH-124499)
(cherry picked from commit abe5f79)

Co-authored-by: sobolevn <mail@sobolevn.me>
Daraan added a commit to Daraan/typing_extensions that referenced this pull request Sep 26, 2024
Yhg1s pushed a commit that referenced this pull request Sep 30, 2024
…arams=()` (GH-124499) (#124603)

gh-124498: Fix `TypeAliasType` not to be generic, when `type_params=()` (GH-124499)
(cherry picked from commit abe5f79)

Co-authored-by: sobolevn <mail@sobolevn.me>
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.

2 participants