summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Curtin <brian@python.org>2011-08-10 20:05:21 -0500
committerBrian Curtin <brian@python.org>2011-08-10 20:05:21 -0500
commit7d2f9e13424fe74814e14cf92d7bbd779917a5c5 (patch)
tree4213eb1f256a704704a84065a0c5bad445da06e6
parent257a1d0f289da018f71836014ff9c6e5aac01295 (diff)
downloadcpython-git-7d2f9e13424fe74814e14cf92d7bbd779917a5c5.tar.gz
Add Py_RETURN_NOTIMPLEMENTED macro. Fixes #12724.
-rw-r--r--Include/object.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Include/object.h b/Include/object.h
index 3753785966..e0c68c133d 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -792,6 +792,10 @@ not implemented for a given type combination.
PyAPI_DATA(PyObject) _Py_NotImplementedStruct; /* Don't use this directly */
#define Py_NotImplemented (&_Py_NotImplementedStruct)
+/* Macro for returning Py_NotImplemented from a function */
+#define Py_RETURN_NOTIMPLEMENTED \
+ return Py_INCREF(Py_NotImplemented), Py_NotImplemented
+
/* Rich comparison opcodes */
#define Py_LT 0
#define Py_LE 1