Mercurial > cpython-lru_cache-weakref
diff Objects/classobject.c @ 4426:75abe737e70b legacy-trunk
Support passing in an empty dictionary of keywords to newinstanceobject.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 21 Oct 1996 15:12:32 +0000 |
| parents | 0036dcf28402 |
| children | 65d2d8e67da3 |
line wrap: on
line diff
--- a/Objects/classobject.c Mon Oct 21 15:11:12 1996 +0000 +++ b/Objects/classobject.c Mon Oct 21 15:12:32 1996 +0000 @@ -347,7 +347,9 @@ if (init == NULL) { err_clear(); if (arg != NULL && (!is_tupleobject(arg) || - gettuplesize(arg) != 0) || kw != NULL) { + gettuplesize(arg) != 0) + || kw != NULL && (!is_dictobject(kw) || + getdictsize(kw) != 0)) { err_setstr(TypeError, "this constructor takes no arguments"); DECREF(inst);
