bpo-29695: Deprecated using bad named keyword arguments in builtings: (#486)

int(), bool(), float(), list() and tuple().  Specify the value as a
positional argument instead.
This commit is contained in:
Serhiy Storchaka 2017-03-06 00:53:39 +02:00 committed by GitHub
parent d31b28e16a
commit 58d23e6806
12 changed files with 65 additions and 2 deletions

View file

@ -4811,6 +4811,12 @@ long_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
}
return PyLong_FromLong(0L);
}
if (PyTuple_GET_SIZE(args) == 0) {
if (PyErr_Warn(PyExc_DeprecationWarning,
"Using 'x' as a keyword argument is deprecated; "
"specify the value as a positional argument instead") < 0)
return NULL;
}
if (obase == NULL)
return PyNumber_Long(x);