diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-03-06 00:53:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-06 00:53:39 +0200 |
commit | 58d23e68068996c76cac78887ec67dee68cdbc72 (patch) | |
tree | 08c445d38282d71be01f109d459d7448364aec0e /Objects/longobject.c | |
parent | d31b28e16a2387d0251df948ef5d1b33d4357652 (diff) | |
download | cpython-git-58d23e68068996c76cac78887ec67dee68cdbc72.tar.gz |
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.
Diffstat (limited to 'Objects/longobject.c')
-rw-r--r-- | Objects/longobject.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c index 0bf6cee6c1..6c47602077 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -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); |