gh-000000: Convert PyBool_Check, PyBytes_Check & PyBytes_CheckExact macro to a function#149558
gh-000000: Convert PyBool_Check, PyBytes_Check & PyBytes_CheckExact macro to a function#149558bschoenmaeckers wants to merge 7 commits intopython:mainfrom
PyBool_Check, PyBytes_Check & PyBytes_CheckExact macro to a function#149558Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
112f4a9 to
df45d6b
Compare
Documentation build overview
4 files changed± c-api/bool.html± c-api/stable.html± whatsnew/3.16.html± whatsnew/changelog.html |
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
| #undef PyBool_Check | ||
|
|
||
| int | ||
| PyBool_Check(PyObject *x) | ||
| { | ||
| return Py_IS_TYPE(x, &PyBool_Type); | ||
| } | ||
|
|
There was a problem hiding this comment.
These should be at the end of the file, so all the internal implementations see the macro version.
These will become repetitive enough that I'd prefer condensed formatting (per the first rule in PEP 7):
// Implementations for the Stable ABI
#undef PyBool_Check
int PyBool_Check(PyObject *x) { return Py_IS_TYPE(x, &PyBool_Type); }But @vstinner might disagree with that :)
There was a problem hiding this comment.
I've moved it to the end of the file and used the condensed formatting.
Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
2 similar comments
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Co-authored-by: Petr Viktorin <encukou@gmail.com>
63e3c03 to
f2a576f
Compare
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
|
Great! Do you want me to do it in this PR? |
e125de5 to
f787075
Compare
|
Yeah, it would fit the title ;) |
PyBytes_Check macro to a functionPyBool_Check , PyBytes_Check & PyBytes_CheckExact macro to a function
PyBool_Check , PyBytes_Check & PyBytes_CheckExact macro to a functionPyBool_Check, PyBytes_Check & PyBytes_CheckExact macro to a function
|
I don't get the rationale for hiding the implementation details of these macros. I don't think that it's worth it. |
As discussed at https://discuss.python.org/t/c-api-add-py-getbuildintype-and-py-getbuildintypeborrowed/107010/12.
This converts the first type check macro to a function export instead when compiling for the limited api.