are no digits, :exc:`ValueError` will be raised.
-.. c:function:: PyObject* PyLong_FromUnicode(Py_UNICODE *u, Py_ssize_t length, int base)
-
- Convert a sequence of Unicode digits to a Python integer value. The Unicode
- string is first encoded to a byte string using :c:func:`PyUnicode_EncodeDecimal`
- and then converted using :c:func:`PyLong_FromString`.
-
- .. deprecated-removed:: 3.3 4.0
- Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
- :c:func:`PyLong_FromUnicodeObject`.
-
-
.. c:function:: PyObject* PyLong_FromUnicodeObject(PyObject *u, int base)
Convert a sequence of Unicode digits in the string *u* to a Python integer
PyLong_FromString:char**:pend::
PyLong_FromString:int:base::
-PyLong_FromUnicode:PyObject*::+1:
-PyLong_FromUnicode:Py_UNICODE*:u::
-PyLong_FromUnicode:Py_ssize_t:length::
-PyLong_FromUnicode:int:base::
-
PyLong_FromUnicodeObject:PyObject*::+1:
PyLong_FromUnicodeObject:PyObject*:u:0:
PyLong_FromUnicodeObject:int:base::
* Removed ``PyUnicode_GetMax()``. Please migrate to new (:pep:`393`) APIs.
(Contributed by Inada Naoki in :issue:`41103`.)
+
+* Removed ``PyLong_FromUnicode()``. Please migrate to :c:func:`PyLong_FromUnicodeObject`.
+ (Contributed by Inada Naoki in :issue:`41103`.)
PyAPI_FUNC(PyObject *) PyLong_FromString(const char *, char **, int);
#ifndef Py_LIMITED_API
-Py_DEPRECATED(3.3)
-PyAPI_FUNC(PyObject *) PyLong_FromUnicode(Py_UNICODE*, Py_ssize_t, int);
PyAPI_FUNC(PyObject *) PyLong_FromUnicodeObject(PyObject *u, int base);
PyAPI_FUNC(PyObject *) _PyLong_FromBytes(const char *, Py_ssize_t, int);
#endif
--- /dev/null
+Removed ``PyLong_FromUnicode()``.
return NULL;
if (PyUnicode_Check(o))
- /* The below check is done in PyLong_FromUnicode(). */
+ /* The below check is done in PyLong_FromUnicodeObject(). */
return PyLong_FromUnicodeObject(o, 10);
if (PyBytes_Check(o))
return NULL;
}
-PyObject *
-PyLong_FromUnicode(Py_UNICODE *u, Py_ssize_t length, int base)
-{
- PyObject *v, *unicode = PyUnicode_FromWideChar(u, length);
- if (unicode == NULL)
- return NULL;
- v = PyLong_FromUnicodeObject(unicode, base);
- Py_DECREF(unicode);
- return v;
-}
-
PyObject *
PyLong_FromUnicodeObject(PyObject *u, int base)
{