Closed
Description
Required prerequisites
- Make sure you've read the documentation. Your issue may be addressed there.
- Search the issue tracker and Discussions to verify that this hasn't already been reported. +1 or comment there if it has.
- Consider asking first in the Gitter chat room or in a Discussion.
Problem description
Pybind11 originally reported a CPython bug at python/cpython#92678. It was later found that the current solution for Py_TPFLAGS_MANAGED_DICT
implemented by Pybind11 does not properly support GC for their dictionaries.
Suggestion: used the newly added (3.11b5) unstable functions:
_PyObject_VisitManagedDict
_PyObject_ClearManagedDict
to properly implement tp_clear
and tp_traverse
for types with Py_TPFLAGS_MANAGED_DICT
set.
Functions were added in https://github.com/python/cpython/pull/95256/files.
Reproducible example code
No response