From 2c257ab0f85396664536605666af9a6f00c73a4f Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 26 Mar 2016 04:10:11 -0700 Subject: Responsibility for argument checking belongs in set.__init__() rather than set.__new__(). See dict.__new__() and list.__new__() for comparison. Neither of those examine or touch args or kwds. That work is done in the __init__() methods. --- Objects/setobject.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/Objects/setobject.c b/Objects/setobject.c index 8e22b69..34235f8 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -1131,9 +1131,6 @@ PySet_Fini(void) static PyObject * set_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { - if (kwds != NULL && type == &PySet_Type && !_PyArg_NoKeywords("set()", kwds)) - return NULL; - return make_new_set(type, NULL); } -- cgit v0.12