]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-47164: Add _PyCFunctionObject_CAST() macr (GH-32190)
authorVictor Stinner <vstinner@python.org>
Thu, 31 Mar 2022 08:03:13 +0000 (10:03 +0200)
committerGitHub <noreply@github.com>
Thu, 31 Mar 2022 08:03:13 +0000 (10:03 +0200)
commit7fc39a21cb85163a456eab91b52e5fe85e7f7e3e
tree98906f50347a47f64e17d990751c6e7067dafa01
parentf0bc69485677ae8973685866ada0982976d3878f
bpo-47164: Add _PyCFunctionObject_CAST() macr (GH-32190)

Add _PyCFunctionObject_CAST() and _PyCMethodObject_CAST() macros to
make macros casting their argument easier to read, but also to check
the type of their input in debug mode: assert(PyCFunction_Check(func)
and assert(PyCMethod_Check(func).

Reformat also PyCFunction_XXX() macros for readability.
Include/cpython/methodobject.h