mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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:
parent
d31b28e16a
commit
58d23e6806
12 changed files with 65 additions and 2 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue