-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
PEP 689: Semi-stable C API tier #2559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More comments than I intended, sorry! Some are very trivial, some are larger points (although I'm not an expert in the C-API, so please ignore things that I've gotten wrong).
A
pep-0689.rst
Outdated
We need a tier between Public and Private to accomodate tools like | ||
advanced debuggers and JIT compilers, which need access to CPython | ||
internals but assume the C-API they use does not change in patch releases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style / semantics -- I would phrase this the other way around, introducing the requirement first rather than "We need". Something like:
We need a tier between Public and Private to accomodate tools like | |
advanced debuggers and JIT compilers, which need access to CPython | |
internals but assume the C-API they use does not change in patch releases. | |
Tools requring access to CPython internals (e.g. advanced | |
debuggers and JIT compilers) are often built for minor series releases | |
of CPython, and assume that the C-API interals used do not change | |
in patch releases. To support these tools, we need a tier between the | |
Public and Private C-API, with guarantees on stability throughout | |
the minor-series release. |
Caveat: this is a stab at language, my terminology might be far off the mark, and it may be entirely out of line with what you intend to express.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is what I wanted to say, but it uses twice as much text to say it.
Why is it better? (That's a genuine question.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current wording is in the rationale section, which is setting out the justification for the proposal. To me, it seems odd to phrase it "We need <feature> because <thing> requires <requirement>, but we don't guarantee requirement.
My suggested rephrasing more explicity spells out that we want to support <thing> properly, there is a reason the current state doesn't work (no guarantees at an API level of stability), and hence <feature> is needed that provides those guarantees.
So this was more a "readability" suggestion, though as author you very much have the right to reject it!
A
Open Issues | ||
=========== | ||
|
||
- “Semi-stable” is not a perfect name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sphinx will auto-convert the quotes.
- “Semi-stable” is not a perfect name. | |
- "Semi-stable" is not a perfect name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it accepts proper quotes as well, as far as I know.
Specification | ||
============= | ||
|
||
Several functions and types (“APIs”) will be moved to a new *semi-stable* tier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several functions and types (“APIs”) will be moved to a new *semi-stable* tier. | |
Several functions and types ("APIs") will be moved to a new *semi-stable* tier. |
stability. | ||
|
||
However, leading underscores usually mark *fully private* API. | ||
CPython developers familiar with the “underscore means internal” |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CPython developers familiar with the “underscore means internal” | |
CPython developers familiar with the "underscore means internal" |
Rejected Ideas | ||
============== | ||
|
||
It might be good to add a similar tier in the Python (not C) API, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like in practice this is already true for e.g. the ast
module; I think Guido brought that up in the past too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But like with CodeType, there's no warning outside the documentation. It's easy to miss this in a review.
Open Issues | ||
=========== | ||
|
||
- “Semi-stable” is not a perfect name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really like the name either, but haven't been able to think of anything better.
pep-0689.rst
Outdated
We need a tier between Public and Private to accomodate tools like | ||
advanced debuggers and JIT compilers, which need access to CPython | ||
internals but assume the C-API they use does not change in patch releases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is what I wanted to say, but it uses twice as much text to say it.
Why is it better? (That's a genuine question.)
Rejected Ideas | ||
============== | ||
|
||
It might be good to add a similar tier in the Python (not C) API, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But like with CodeType, there's no warning outside the documentation. It's easy to miss this in a review.
Co-authored-by: Adam Turner <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
Thank you for the editing! |
> The current wording is in the rationale section, which is > setting out the justification for the proposal. To me, it > seems odd to phrase it "We need <feature> because <thing> > requires <requirement>, but we don't guarantee requirement. > > My suggested rephrasing more explicity spells out that we > want to support <thing> properly, there is a reason the > current state doesn't work (no guarantees at an API level > of stability), and hence <feature> is needed that provides > those guarantees. - python#2559 (comment)
> The current wording is in the rationale section, which is > setting out the justification for the proposal. To me, it > seems odd to phrase it "We need <feature> because <thing> > requires <requirement>, but we don't guarantee requirement. > > My suggested rephrasing more explicity spells out that we > want to support <thing> properly, there is a reason the > current state doesn't work (no guarantees at an API level > of stability), and hence <feature> is needed that provides > those guarantees. - python#2559 (comment)
A PEP for python/cpython#91744