Petr Viktorin <encu...@gmail.com> added the comment:
Now that I see the implementation (and now that I'm spending a lot of time trying to formalize what is good stable API), I see a problem with PyType_GetName: it effectively returns a borrowed reference. The proposed docs say: Callers can hold [the retuned] pointer until the type has been deallocated. This is not friendly to alternate Python implementations. For example, if tp_name is stored as UTF-32, it would need to generate the char* data -- and then retain it until the class is deallocated. I guess the "correct" way would be to return a Py_buffer, which would (in CPython) reference the class. Victor, what do you think? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue42035> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com