* Added a new method flag, METH_COEXIST.

* Used the flag to optimize set.__contains__(), dict.__contains__(),
  dict.__getitem__(), and list.__getitem__().
This commit is contained in:
Raymond Hettinger 2003-12-13 11:26:12 +00:00
parent feb78c94fa
commit 8f5cdaa784
8 changed files with 97 additions and 3 deletions

View file

@ -67,7 +67,7 @@ PyCFunction_Call(PyObject *func, PyObject *arg, PyObject *kw)
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);