-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
bpo-29727: Register array.array as a MutableSequence #21338
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
brandtbucher
left a comment
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.
I like the tests! Noticed one small opportunity to simplify the register call, but looks good either way:
| Py_DECREF((PyObject *)&Arraytype); | ||
| return -1; | ||
| } | ||
| PyObject *res = PyObject_CallMethod(mutablesequence, "register", "O", (PyObject *)&Arraytype); |
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.
| PyObject *res = PyObject_CallMethod(mutablesequence, "register", "O", (PyObject *)&Arraytype); | |
| _Py_IDENTIFIER(register); | |
| PyObject *res = _PyObject_CallMethodIdOneArg(mutablesequence, &PyId_register, | |
| (PyObject *)&Arraytype); |
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.
Thanks, @brandtbucher. The reason I originally did not add _Py_IDENTIFIER is so we don't add more to the global/static state so it does not make future sub interpreters isolation harder, especially given that this code will run only at module import time.
|
Thanks for the review! |
This comment has been minimized.
This comment has been minimized.
The failure is unrelated to this PR:
|
https://bugs.python.org/issue29727