New submission from Ronald Oussoren <ronaldousso...@mac.com>:
The documentation for PyType_Spec and the related functions is not clear about the required lifetime of fields of PyType_Spec. In particular, PyType_Spec.name must remain valid for the entire lifetime of types created with PyType_FromSpec*. The documentation doesn't mention this. I ran into this with code that calculates the name as needed an cleans up the memory used for the type spec after creating the type. The type appears to work fine when looking at it in Python scripts, but the tp_name slot is wrong. ---------- assignee: docs@python components: Documentation messages: 407676 nosy: docs@python, ronaldoussoren priority: normal severity: normal status: open title: PyType_Spec.name must remain valid after PyType_FromSpec type: behavior versions: Python 3.10 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue45983> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com