mirror of
https://github.com/python/cpython
synced 2026-09-29 10:50:29 +03:00
Methods of built-in types now properly check for keyword arguments
(formerly these were silently ignored). The only built-in methods that take keyword arguments are __call__, __init__ and __new__.
This commit is contained in:
parent
d6bebce5e5
commit
c8e5645f15
5 changed files with 45 additions and 12 deletions
|
|
@ -14,15 +14,22 @@ typedef struct PyGetSetDef {
|
|||
typedef PyObject *(*wrapperfunc)(PyObject *self, PyObject *args,
|
||||
void *wrapped);
|
||||
|
||||
typedef PyObject *(*wrapperfunc_kwds)(PyObject *self, PyObject *args,
|
||||
void *wrapped, PyObject *kwds);
|
||||
|
||||
struct wrapperbase {
|
||||
char *name;
|
||||
int offset;
|
||||
void *function;
|
||||
wrapperfunc wrapper;
|
||||
char *doc;
|
||||
int flags;
|
||||
PyObject *name_strobj;
|
||||
};
|
||||
|
||||
/* Flags for above struct */
|
||||
#define PyWrapperFlag_KEYWORDS 1 /* wrapper function takes keyword args */
|
||||
|
||||
/* Various kinds of descriptor objects */
|
||||
|
||||
#define PyDescr_COMMON \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue