summaryrefslogtreecommitdiffstats
path: root/Include/cpython/methodobject.h
Commit message (Collapse)AuthorAgeFilesLines
* gh-87347: Add parenthesis around PyXXX_Check() arguments (#92815)Victor Stinner2022-06-161-2/+2
|
* gh-89653: PEP 670: Macros always cast arguments in cpython/ (#93766)Victor Stinner2022-06-131-12/+4
| | | | Header files in the Include/cpython/ are only included if the Py_LIMITED_API macro is not defined.
* gh-89653: PEP 670: Convert PyCFunction macros to functions (#92302)Victor Stinner2022-05-051-24/+56
| | | | | | | | | | Convert the following macros to static inline functions: * PyCFunction_GET_CLASS() * PyCFunction_GET_FLAGS() * PyCFunction_GET_FUNCTION() * PyCFunction_GET_SELF() Limited C API version 3.11 no longer casts arguments.
* gh-92135: Rename _Py_reinterpret_cast() to _Py_CAST() (#92230)Victor Stinner2022-05-031-2/+2
| | | Rename also _Py_static_cast() to _Py_STATIC_CAST().
* gh-91320: Add _Py_reinterpret_cast() macro (#91959)Victor Stinner2022-04-271-2/+4
| | | | | | | | | | | | | | Fix C++ compiler warnings about "old-style cast" (g++ -Wold-style-cast) in the Python C API. Use C++ reinterpret_cast<> and static_cast<> casts when the Python C API is used in C++. Example of fixed warning: Include/object.h:107:43: error: use of old-style cast to ‘PyObject*’ {aka ‘struct _object*’} [-Werror=old-style-cast] #define _PyObject_CAST(op) ((PyObject*)(op)) Add _Py_reinterpret_cast() and _Py_static_cast() macros.
* bpo-47164: Add _PyCFunctionObject_CAST() macr (GH-32190)Victor Stinner2022-03-311-6/+11
| | | | | | | | 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.
* bpo-38787: Add PyCFunction_CheckExact() macro for exact type checks (GH-20024)scoder2020-05-121-0/+3
| | | | | … now that we allow subtypes of PyCFunction. Also add PyCMethod_CheckExact() and PyCMethod_Check() for checks against the PyCMethod subtype.
* bpo-38787: C API for module state access from extension methods (PEP 573) ↵Petr Viktorin2020-05-071-0/+32
(GH-19936) Module C state is now accessible from C-defined heap type methods (PEP 573). Patch by Marcel Plch and Petr Viktorin. Co-authored-by: Marcel Plch <mplch@redhat.com> Co-authored-by: Victor Stinner <vstinner@python.org>