bpo-40170: PyType_SUPPORTS_WEAKREFS() becomes a regular function by vstinner · Pull Request #30938 · python/cpython

@vstinner

Convert the PyType_SUPPORTS_WEAKREFS() macro to a regular function.
It no longer access the PyTypeObject.tp_weaklistoffset member
directly.

Add _PyType_SUPPORTS_WEAKREFS() static inline functions, used
internally by Python for best performances.

@vstinner vstinner marked this pull request as ready for review

January 27, 2022 01:44