summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-12-13 11:26:12 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-12-13 11:26:12 (GMT)
commit8f5cdaa784f555149adf5e94fd2e989f99d6b1db (patch)
treed6a8f66d75cc46f849b5933fb2a57b41e76a7d4f /Include
parentfeb78c94fa444a75b912ca355c3c80d7453f03f0 (diff)
downloadcpython-8f5cdaa784f555149adf5e94fd2e989f99d6b1db.zip
cpython-8f5cdaa784f555149adf5e94fd2e989f99d6b1db.tar.gz
cpython-8f5cdaa784f555149adf5e94fd2e989f99d6b1db.tar.bz2
* Added a new method flag, METH_COEXIST.
* Used the flag to optimize set.__contains__(), dict.__contains__(), dict.__getitem__(), and list.__getitem__().
Diffstat (limited to 'Include')
-rw-r--r--Include/methodobject.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Include/methodobject.h b/Include/methodobject.h
index 887385d..0f60549 100644
--- a/Include/methodobject.h
+++ b/Include/methodobject.h
@@ -58,6 +58,13 @@ PyAPI_FUNC(PyObject *) PyCFunction_NewEx(PyMethodDef *, PyObject *,
#define METH_CLASS 0x0010
#define METH_STATIC 0x0020
+/* METH_COEXIST allows a method to be entered eventhough a slot has
+ already filled the entry. When defined, the flag allows a separate
+ method, "__contains__" for example, to coexist with a defined
+ slot like sq_contains. */
+
+#define METH_COEXIST 0x0040
+
typedef struct PyMethodChain {
PyMethodDef *methods; /* Methods of this type */
struct PyMethodChain *link; /* NULL or base type */