[WIP] bpo-1635741: Port _collections module to multiphase initialization. by corona10 · Pull Request #19071 · python/cpython

@corona10

corona10

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 corona10 changed the title bpo-1635741: Port _collections module to multiphase initialization. [WIP] bpo-1635741: Port _collections module to multiphase initialization.

Mar 19, 2020

@corona10

vstinner

&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.

@shihai1991

@kylotan kylotan mannequin mentioned this pull request

Sep 19, 2022