Skip to content

Commit 2c257ab

Browse files
committed
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.
1 parent 9423023 commit 2c257ab

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

‎Objects/setobject.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,9 +1131,6 @@ PySet_Fini(void)
11311131
static PyObject *
11321132
set_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
11331133
{
1134-
if (kwds != NULL && type == &PySet_Type && !_PyArg_NoKeywords("set()", kwds))
1135-
return NULL;
1136-
11371134
return make_new_set(type, NULL);
11381135
}
11391136

0 commit comments

Comments
 (0)