mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
SF #1486663 -- Allow keyword args in subclasses of set() and frozenset().
This commit is contained in:
parent
a398e2d059
commit
9fdfadb06e
2 changed files with 13 additions and 2 deletions
|
@ -1004,7 +1004,7 @@ frozenset_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
{
|
||||
PyObject *iterable = NULL, *result;
|
||||
|
||||
if (!_PyArg_NoKeywords("frozenset()", kwds))
|
||||
if (type == &PyFrozenSet_Type && !_PyArg_NoKeywords("frozenset()", kwds))
|
||||
return NULL;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, type->tp_name, 0, 1, &iterable))
|
||||
|
@ -1048,7 +1048,7 @@ PySet_Fini(void)
|
|||
static PyObject *
|
||||
set_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
if (!_PyArg_NoKeywords("set()", kwds))
|
||||
if (type == &PySet_Type && !_PyArg_NoKeywords("set()", kwds))
|
||||
return NULL;
|
||||
|
||||
return make_new_set(type, NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue