File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,10 @@ PyAPI_DATA(PyIntObject) _Py_ZeroStruct, _Py_TrueStruct;
2323#define Py_False ((PyObject *) &_Py_ZeroStruct)
2424#define Py_True ((PyObject *) &_Py_TrueStruct)
2525
26+ /* Macros for returning Py_True or Py_False, respectively */
27+ #define Py_RETURN_TRUE Py_INCREF(Py_True); return Py_True;
28+ #define Py_RETURN_FALSE Py_INCREF(Py_False); return Py_False;
29+
2630/* Function to return a bool from a C long */
2731PyAPI_FUNC (PyObject * ) PyBool_FromLong (long );
2832
Original file line number Diff line number Diff line change @@ -633,6 +633,9 @@ Don't forget to apply Py_INCREF() when returning this value!!!
633633PyAPI_DATA (PyObject ) _Py_NoneStruct ; /* Don't use this directly */
634634#define Py_None (&_Py_NoneStruct)
635635
636+ /* Macro for returning Py_None from a function */
637+ #define Py_RETURN_NONE Py_INCREF(Py_None); return Py_None;
638+
636639/*
637640Py_NotImplemented is a singleton used to signal that an operation is
638641not implemented for a given type combination.
You can’t perform that action at this time.
0 commit comments