[issue42035] [C API] PyType_GetSlot cannot get tp_name

hai shi report at bugs.python.org
Thu Jan 21 00:02:39 EST 2021


hai shi <shihai1991 at 126.com> added the comment:

> New C API functions must not return borrowed references, but strong references.

Thanks petr, victor for your suggestion. It's more friendly to users.

> Which one should be returned by PyType_GetName()? Is there a warranty that it's always short or always qualified?

Returning short or qualified name depends on how to define the tp_name in PyType_Spec or type object. IMHO, PyType_GetName() return the original defined type name is fine to users.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42035>
_______________________________________


More information about the Python-bugs-list mailing list