-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
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
Conversation
@@ -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 |
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.
Can it ever be NULL? Can't hurt to have this check though.
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.
Old code assumed this path with Py_XNewRef
, so I just followed the same style.
Thanks @sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
…rams=()` (pythonGH-124499) (cherry picked from commit abe5f79) Co-authored-by: sobolevn <mail@sobolevn.me>
GH-124603 is a backport of this pull request to the 3.13 branch. |
…rams=()` (pythonGH-124499) (cherry picked from commit abe5f79) Co-authored-by: sobolevn <mail@sobolevn.me>
GH-124604 is a backport of this pull request to the 3.12 branch. |
type_params=()
is passed. #124498