Message379291
True enough. Btw, PyType_FromSpec accepts Py_tp_doc (char *), Py_tp_base (PyTypeObject *), etc ... so to be strictly standard compliant, a union would be necessary.
PyType_GetName() sounds great.
One "proper" workaround at the moment is PyObject_GetAttrString(Py_TYPE(x), "__name__") and then process the result. This is somewhat "heavy" and strips the module name. "Py_tp_name" provides a convenient, exception safe, and backward compatible way to access tp_name.
What I actually do right now is to access the (opaque) PyTypeObject::tp_name by pointer offset. This certain defies the purpose of stable ABI! |
|
Date |
User |
Action |
Args |
2020-10-22 13:22:12 | fancitron | set | recipients:
+ fancitron, petr.viktorin, corona10 |
2020-10-22 13:22:12 | fancitron | set | messageid: <1603372932.12.0.669490145324.issue42035@roundup.psfhosted.org> |
2020-10-22 13:22:12 | fancitron | link | issue42035 messages |
2020-10-22 13:22:11 | fancitron | create | |
|