the last call to :c:func:`Py_Initialize`. Ideally, this frees all memory
allocated by the Python interpreter. This is a no-op when called for a second
time (without calling :c:func:`Py_Initialize` again first). Normally the
- return value is 0. If there were errors during finalization
- (flushing buffered data), -1 is returned.
+ return value is ``0``. If there were errors during finalization
+ (flushing buffered data), ``-1`` is returned.
This function is provided for a number of reasons. An embedding application
might want to restart Python without having to restart the application itself.
Raise :exc:`OverflowError` if the value of *obj* is out of range for a
:c:type:`long`.
- Returns -1 on error. Use :c:func:`PyErr_Occurred` to disambiguate.
+ Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate.
.. c:function:: long PyLong_AsLongAndOverflow(PyObject *obj, int *overflow)
return ``-1``; otherwise, set *\*overflow* to ``0``. If any other exception
occurs set *\*overflow* to ``0`` and return ``-1`` as usual.
- Returns -1 on error. Use :c:func:`PyErr_Occurred` to disambiguate.
+ Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate.
.. c:function:: long long PyLong_AsLongLong(PyObject *obj)
Raise :exc:`OverflowError` if the value of *obj* is out of range for a
:c:type:`long`.
- Returns -1 on error. Use :c:func:`PyErr_Occurred` to disambiguate.
+ Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate.
.. c:function:: long long PyLong_AsLongLongAndOverflow(PyObject *obj, int *overflow)
and return ``-1``; otherwise, set *\*overflow* to ``0``. If any other
exception occurs set *\*overflow* to ``0`` and return ``-1`` as usual.
- Returns -1 on error. Use :c:func:`PyErr_Occurred` to disambiguate.
+ Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate.
.. versionadded:: 3.2
Raise :exc:`OverflowError` if the value of *pylong* is out of range for a
:c:type:`Py_ssize_t`.
- Returns -1 on error. Use :c:func:`PyErr_Occurred` to disambiguate.
+ Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate.
.. c:function:: unsigned long PyLong_AsUnsignedLong(PyObject *pylong)
If the value of *obj* is out of range for an :c:type:`unsigned long`,
return the reduction of that value modulo ``ULONG_MAX + 1``.
- Returns -1 on error. Use :c:func:`PyErr_Occurred` to disambiguate.
+ Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate.
.. c:function:: unsigned long long PyLong_AsUnsignedLongLongMask(PyObject *obj)
If the value of *obj* is out of range for an :c:type:`unsigned long long`,
return the reduction of that value modulo ``PY_ULLONG_MAX + 1``.
- Returns -1 on error. Use :c:func:`PyErr_Occurred` to disambiguate.
+ Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate.
.. c:function:: double PyLong_AsDouble(PyObject *pylong)
Raise :exc:`OverflowError` if the value of *pylong* is out of range for a
:c:type:`double`.
- Returns -1.0 on error. Use :c:func:`PyErr_Occurred` to disambiguate.
+ Returns ``-1.0`` on error. Use :c:func:`PyErr_Occurred` to disambiguate.
.. c:function:: void* PyLong_AsVoidPtr(PyObject *pylong)
is only assured to produce a usable :c:type:`void` pointer for values created
with :c:func:`PyLong_FromVoidPtr`.
- Returns NULL on error. Use :c:func:`PyErr_Occurred` to disambiguate.
+ Returns *NULL* on error. Use :c:func:`PyErr_Occurred` to disambiguate.
can't guarantee that the initializer is called. The initializer isn't called
when unpickling objects and it can be overridden. Our initializer accepts
arguments to provide initial values for our instance. Initializers always accept
-positional and keyword arguments. Initializers should return either 0 on
-success or -1 on error.
+positional and keyword arguments. Initializers should return either ``0`` on
+success or ``-1`` on error.
Initializers can be called multiple times. Anyone can call the :meth:`__init__`
method on our objects. For this reason, we have to be extra careful when
:c:func:`PyUnicode_FromFormat()`, your code will automatically take
advantage of the new unicode representations.
-* :c:func:`PyImport_GetMagicNumber` now returns -1 upon failure.
+* :c:func:`PyImport_GetMagicNumber` now returns ``-1`` upon failure.
* As a negative value for the *level* argument to :func:`__import__` is no
longer valid, the same now holds for :c:func:`PyImport_ImportModuleLevel`.
This also means that the value of *level* used by
- :c:func:`PyImport_ImportModuleEx` is now 0 instead of -1.
+ :c:func:`PyImport_ImportModuleEx` is now ``0`` instead of ``-1``.
Building C extensions