This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author petr.viktorin
Recipients corona10, fancitron, petr.viktorin, shihai1991, vstinner
Date 2021-01-19.16:43:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1611074603.46.0.145148106947.issue42035@roundup.psfhosted.org>
In-reply-to
Content
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?
History
Date User Action Args
2021-01-19 16:43:23petr.viktorinsetrecipients: + petr.viktorin, vstinner, corona10, shihai1991, fancitron
2021-01-19 16:43:23petr.viktorinsetmessageid: <1611074603.46.0.145148106947.issue42035@roundup.psfhosted.org>
2021-01-19 16:43:23petr.viktorinlinkissue42035 messages
2021-01-19 16:43:23petr.viktorincreate