mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44: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
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue