Created originally on Bitbucket by CFSworks (Sam Edwards)
Was already merged in Bitbucket before import, marked as merged by the import user
Per the documentation for tp_dict
in CPython’s API:
This field should normally be initialized to
NULL
before PyType_Ready is called; it may also be initialized to a dictionary containing initial attributes for the type.
The implementation here differs slightly in that I’m copying the attributes out (necessary because PyPy uses a completely different dict strategy for classes). This does mean tp_dict
will change after PyType_Ready
, but extensions probably shouldn’t be depending on the tp_dict
pointer being constant in the first place.