-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-119521: Rename IncompleteInputError to _IncompleteInputError and remove from stable ABI #119680
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.
Should we use __IncompleteInputError__
? There are currently no other classes with a single underscore in the builtins, but there are some other internal names that use dunders (e.g., __import__
, __build_class__
).
That would be a bit weird IMHO because those dunder methods are hooks or functions, not classes |
… and remove from stable ABI Signed-off-by: Pablo Galindo <[email protected]>
Include/pyerrors.h
Outdated
@@ -108,7 +108,9 @@ PyAPI_DATA(PyObject *) PyExc_NotImplementedError; | |||
PyAPI_DATA(PyObject *) PyExc_SyntaxError; | |||
PyAPI_DATA(PyObject *) PyExc_IndentationError; | |||
PyAPI_DATA(PyObject *) PyExc_TabError; | |||
#if !defined(Py_LIMITED_API) | |||
PyAPI_DATA(PyObject *) PyExc_IncompleteInputError; |
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.
Does it need to be exported at all? An extension can always do PyObject_GetAttrString(Py_GetBuiltins(), "_IncompleteInputError"))
(or whatever the "GetBuiltins" call actually is) if it needs a reference.
Removing from the limited API is definitely the right thing. Luckily we caught it pre-release.
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.
We are using it in the parser so it needs to be exported in the headers somehow. Or do you mean we can just use "extern" for it?
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.
Yeah, just extern
would mean it's available in builds that are also building its source file, while PyAPI_
means it's exported for use by other apps that link to our binaries. (I think the distinction is more strictly enforced on Windows than POSIX, but we can at least capture our intent.)
@pablogsal Do you plan to get back to this? Should I take over? |
I think the only thing missing is #119680 (comment) I can try to do it this week, but feel free to take over if you have free cycles |
How's this? It won't expose a public pointer at all, instead there's |
LGTM |
Thanks @pablogsal for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
… and remove from public API/ABI (pythonGH-119680) (cherry picked from commit ac61d58) Co-authored-by: Pablo Galindo Salgado <[email protected]> Signed-off-by: Pablo Galindo <[email protected]> Co-authored-by: Petr Viktorin <[email protected]>
GH-120944 is a backport of this pull request to the 3.13 branch. |
|
|
|
|
|
|
|
|
|
|
(edit: fixed in #120955) |
…teInputError`
…r and remove from public API/ABI (GH-119680, GH-120955) (GH-120944) - gh-119521: Rename IncompleteInputError to _IncompleteInputError and remove from public API/ABI (GH-119680) (cherry picked from commit ce1064e) - gh-119521: Use `PyAPI_DATA`, not `extern`, for `_PyExc_IncompleteInputError` (GH-120955) (cherry picked from commit ac61d58) Co-authored-by: Pablo Galindo Salgado <[email protected]> Co-authored-by: Petr Viktorin <[email protected]>
… and remove from public API/ABI (pythonGH-119680) Signed-off-by: Pablo Galindo <[email protected]> Co-authored-by: Petr Viktorin <[email protected]>
… and remove from public API/ABI (pythonGH-119680) Signed-off-by: Pablo Galindo <[email protected]> Co-authored-by: Petr Viktorin <[email protected]>
… and remove from public API/ABI (pythonGH-119680) Signed-off-by: Pablo Galindo <[email protected]> Co-authored-by: Petr Viktorin <[email protected]>
IncompleteInputError
is undocumented #119521📚 Documentation preview 📚: https://cpython-previews--119680.org.readthedocs.build/