mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
type_call(): Change in policy. The keyword args (if any) are now passed
on to the tp_new slot (if non-NULL), as well as to the tp_init slot (if any). A sane type implementing both tp_new and tp_init should probably pay attention to the arguments in only one of them.
This commit is contained in:
parent
bafedecc06
commit
3f996e7266
2 changed files with 14 additions and 3 deletions
|
@ -151,7 +151,7 @@ type_call(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
obj = type->tp_new(type, args, NULL);
|
||||
obj = type->tp_new(type, args, kwds);
|
||||
if (obj != NULL) {
|
||||
type = obj->ob_type;
|
||||
if (type->tp_init != NULL &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue