mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
* 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:
parent
feb78c94fa
commit
8f5cdaa784
8 changed files with 97 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue