[Python-checkins] cpython: Add Py_RETURN_NOTIMPLEMENTED macro. Fixes #12724.

brian.curtin python-checkins at python.org
Thu Aug 11 03:34:37 CEST 2011


http://hg.python.org/cpython/rev/77a65b078852
changeset:   71809:77a65b078852
parent:      71803:1b4fae183da3
user:        Brian Curtin <brian at python.org>
date:        Wed Aug 10 20:05:21 2011 -0500
summary:
  Add Py_RETURN_NOTIMPLEMENTED macro. Fixes #12724.

files:
  Include/object.h |  4 ++++
  1 files changed, 4 insertions(+), 0 deletions(-)


diff --git a/Include/object.h b/Include/object.h
--- a/Include/object.h
+++ b/Include/object.h
@@ -792,6 +792,10 @@
 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

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list