Skip to content

Commit 7d2f9e1

Browse files
committed
Add Py_RETURN_NOTIMPLEMENTED macro. Fixes #12724.
1 parent 257a1d0 commit 7d2f9e1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Include/object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,10 @@ not implemented for a given type combination.
792792
PyAPI_DATA(PyObject) _Py_NotImplementedStruct; /* Don't use this directly */
793793
#define Py_NotImplemented (&_Py_NotImplementedStruct)
794794

795+
/* Macro for returning Py_NotImplemented from a function */
796+
#define Py_RETURN_NOTIMPLEMENTED \
797+
return Py_INCREF(Py_NotImplemented), Py_NotImplemented
798+
795799
/* Rich comparison opcodes */
796800
#define Py_LT 0
797801
#define Py_LE 1

0 commit comments

Comments
 (0)