[WIP] bpo-1635741: Port _collections module to multiphase initialization. by corona10 · Pull Request #19071 · python/cpython
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean combine PyType_Ready + _PyType_Name + PyModule_AddObject? Yeah, maybe it's worth it, but I would prefer to add it once this PR lands.
corona10
changed the title
bpo-1635741: Port _collections module to multiphase initialization.
[WIP] bpo-1635741: Port _collections module to multiphase initialization.
| &PyODict_Type, | ||
| &dequeiter_type, | ||
| &dequereviter_type, | ||
| &tuplegetter_type, |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either you use Py_ARRAY_COUNT() to get the list length, or you need to add a NULL terminator. Currently, you rely on an undefined behavior.
kylotan
mannequin
mentioned this pull request
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