On 20.06.2022 18:48, Petr Viktorin wrote:
On 20. 06. 22 17:48, Marc-Andre Lemburg wrote:
On 20.06.2022 17:37, Victor Stinner wrote:
[...] This will benefit both core devs and extension writers, since only a healthy and reasonably complete Python C API will help sustain the popularity and attractiveness of Python in areas which are far away from core development - e.g. most of the PyData or scientific space.
I'm not sure what do you propose in practice?
The idea is that instead of declaring a "don't use" policy, as Petr suggested, we keep the "use at your own risk" policy and add a note suggesting to open a ticket "Please create a public version of the _Py_XYZ API" (because of missing functionality in the public API), whenever making use of a private API.
OK, I see. “Use at your own risk” is a better wording than “don't use”, since it better implies that we'll try not to break things for no reason.
So my proposal would now be:
*Anything* with a leading underscore is unsupported, private, “use at your own risk”. If it is actually supported, that's a CPython bug to fix — see below. If you're using such private API and don't see a public alternative, you should contact CPython devs to: - see if we can add public API for the use case. - let us know that someone's using the API, and we should be extra careful with it.
When something is supported (in any way), it should lose the leading underscore*, get tested so we don't break it, and get documented so the intended semantics (vs. accidental implementation details) is clear.
- (The old underscored name might be kept as an alias to avoid breaking code, which is technically an exception to “Anything with a leading underscore is entirely unsupported”)
Sounds good :-)
That way we get in touch with people who need internal APIs exposed in the public API and can hash out the details more easily.
The code search approach, several core devs are using, is helpful as well, but the direct interaction on a ticket gives you better feedback on the reasons why internal APIs were used.
+1
-- Marc-Andre Lemburg eGenix.com
Professional Python Services directly from the Experts (#1, Jun 20 2022)
Python Projects, Coaching and Support ... https://www.egenix.com/ Python Product Development ... https://consulting.egenix.com/
::: We implement business ideas - efficiently in both time and costs :::
eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 https://www.egenix.com/company/contact/ https://www.malemburg.com/