diff Objects/methodobject.c @ 31172:e4fb6164158c legacy-trunk

* Added a new method flag, METH_COEXIST. * Used the flag to optimize set.__contains__(), dict.__contains__(), dict.__getitem__(), and list.__getitem__().
author Raymond Hettinger <python@rcn.com>
date Sat, 13 Dec 2003 11:26:12 +0000
parents 14451dd3acb0
children 9541369b0dca
line wrap: on
line diff
--- a/Objects/methodobject.c	Fri Dec 12 13:13:47 2003 +0000
+++ b/Objects/methodobject.c	Sat Dec 13 11:26:12 2003 +0000
@@ -67,7 +67,7 @@
 	PyObject *self = PyCFunction_GET_SELF(func);
 	int size;
 
-	switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC)) {
+	switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
 	case METH_VARARGS:
 		if (kw == NULL || PyDict_Size(kw) == 0)
 			return (*meth)(self, arg);