summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/utilities.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-09-01 12:33:24 (GMT)
committerGeorg Brandl <georg@python.org>2007-09-01 12:33:24 (GMT)
commit321976b6e74db8f649e47f2b791c4bcc2a71d127 (patch)
treef3553ef3dd5133f7a285bdd392a85d49c773749d /Doc/c-api/utilities.rst
parent2326a79de134281b12b3ed04eeabcc8c403df57d (diff)
downloadcpython-321976b6e74db8f649e47f2b791c4bcc2a71d127.zip
cpython-321976b6e74db8f649e47f2b791c4bcc2a71d127.tar.gz
cpython-321976b6e74db8f649e47f2b791c4bcc2a71d127.tar.bz2
Remove versionadded and versionchanged directives, fold information into text where necessary.
Diffstat (limited to 'Doc/c-api/utilities.rst')
-rw-r--r--Doc/c-api/utilities.rst61
1 files changed, 7 insertions, 54 deletions
diff --git a/Doc/c-api/utilities.rst b/Doc/c-api/utilities.rst
index 71e9560..35bfe86 100644
--- a/Doc/c-api/utilities.rst
+++ b/Doc/c-api/utilities.rst
@@ -121,6 +121,7 @@ Importing Modules
.. index::
single: package variable; __all__
single: __all__ (package variable)
+ single: modules (in module sys)
This is a simplified interface to :cfunc:`PyImport_ImportModuleEx` below,
leaving the *globals* and *locals* arguments set to *NULL*. When the *name*
@@ -135,11 +136,6 @@ Importing Modules
to find out. Starting with Python 2.4, a failing import of a module no longer
leaves the module in ``sys.modules``.
- .. versionchanged:: 2.4
- failing imports remove incomplete module objects.
-
- .. index:: single: modules (in module sys)
-
.. cfunction:: PyObject* PyImport_ImportModuleEx(char *name, PyObject *globals, PyObject *locals, PyObject *fromlist)
@@ -155,20 +151,16 @@ Importing Modules
when a submodule of a package was requested is normally the top-level package,
unless a non-empty *fromlist* was given.
- .. versionchanged:: 2.4
- failing imports remove incomplete module objects.
+ Failing imports remove incomplete module objects, like with
+ :cfunc:`PyImport_ImportModule`.
.. cfunction:: PyObject* PyImport_Import(PyObject *name)
- .. index::
- module: rexec
- module: ihooks
-
This is a higher-level interface that calls the current "import hook function".
It invokes the :func:`__import__` function from the ``__builtins__`` of the
current globals. This means that the import is done using whatever import hooks
- are installed in the current environment, e.g. by :mod:`rexec` or :mod:`ihooks`.
+ are installed in the current environment.
.. cfunction:: PyObject* PyImport_ReloadModule(PyObject *m)
@@ -213,9 +205,6 @@ Importing Modules
If *name* points to a dotted name of the form ``package.module``, any package
structures not already created will still not be created.
- .. versionchanged:: 2.4
- *name* is removed from ``sys.modules`` in error cases.
-
.. cfunction:: long PyImport_GetMagicNumber()
@@ -345,26 +334,19 @@ upon unmarshalling. *Py_MARSHAL_VERSION* indicates the current file format
Marshal a :ctype:`long` integer, *value*, to *file*. This will only write the
least-significant 32 bits of *value*; regardless of the size of the native
- :ctype:`long` type.
-
- .. versionchanged:: 2.4
- *version* indicates the file format.
+ :ctype:`long` type. *version* indicates the file format.
.. cfunction:: void PyMarshal_WriteObjectToFile(PyObject *value, FILE *file, int version)
Marshal a Python object, *value*, to *file*.
-
- .. versionchanged:: 2.4
- *version* indicates the file format.
+ *version* indicates the file format.
.. cfunction:: PyObject* PyMarshal_WriteObjectToString(PyObject *value, int version)
Return a string object containing the marshalled representation of *value*.
-
- .. versionchanged:: 2.4
- *version* indicates the file format.
+ *version* indicates the file format.
The following functions allow marshalled values to be read back in.
@@ -557,8 +539,6 @@ variable(s) whose address should be passed.
Convert a Python integer to a tiny int without overflow checking, stored in a C
:ctype:`unsigned char`.
- .. versionadded:: 2.3
-
``h`` (integer) [short int]
Convert a Python integer to a C :ctype:`short int`.
@@ -566,8 +546,6 @@ variable(s) whose address should be passed.
Convert a Python integer to a C :ctype:`unsigned short int`, without overflow
checking.
- .. versionadded:: 2.3
-
``i`` (integer) [int]
Convert a Python integer to a plain C :ctype:`int`.
@@ -575,8 +553,6 @@ variable(s) whose address should be passed.
Convert a Python integer to a C :ctype:`unsigned int`, without overflow
checking.
- .. versionadded:: 2.3
-
``l`` (integer) [long int]
Convert a Python integer to a C :ctype:`long int`.
@@ -584,8 +560,6 @@ variable(s) whose address should be passed.
Convert a Python integer or long integer to a C :ctype:`unsigned long` without
overflow checking.
- .. versionadded:: 2.3
-
``L`` (integer) [PY_LONG_LONG]
Convert a Python integer to a C :ctype:`long long`. This format is only
available on platforms that support :ctype:`long long` (or :ctype:`_int64` on
@@ -596,13 +570,9 @@ variable(s) whose address should be passed.
without overflow checking. This format is only available on platforms that
support :ctype:`unsigned long long` (or :ctype:`unsigned _int64` on Windows).
- .. versionadded:: 2.3
-
``n`` (integer) [Py_ssize_t]
Convert a Python integer or long integer to a C :ctype:`Py_ssize_t`.
- .. versionadded:: 2.5
-
``c`` (string of length 1) [char]
Convert a Python character, represented as a string of length 1, to a C
:ctype:`char`.
@@ -677,13 +647,6 @@ variable(s) whose address should be passed.
in *items*. The C arguments must correspond to the individual format units in
*items*. Format units for sequences may be nested.
- .. note::
-
- Prior to Python version 1.5.2, this format specifier only accepted a tuple
- containing the individual parameters, not an arbitrary sequence. Code which
- previously caused :exc:`TypeError` to be raised here may now proceed without an
- exception. This is not expected to be a problem for existing code.
-
It is possible to pass Python long integers where integers are requested;
however no proper range checking is done --- the most significant bits are
silently truncated when the receiving field is too small to receive the value
@@ -798,8 +761,6 @@ return true, otherwise they return false and raise an appropriate exception.
PyArg_ParseTuple(args, "O|O:ref", &object, &callback)
- .. versionadded:: 2.2
-
.. cfunction:: PyObject* Py_BuildValue(const char *format, ...)
@@ -898,8 +859,6 @@ return true, otherwise they return false and raise an appropriate exception.
``n`` (int) [Py_ssize_t]
Convert a C :ctype:`Py_ssize_t` to a Python integer or long integer.
- .. versionadded:: 2.5
-
``c`` (string of length 1) [char]
Convert a C :ctype:`int` representing a character to a Python string of length
1.
@@ -1010,8 +969,6 @@ The following functions provide locale-independent string to number conversions.
:cfunc:`PyOS_ascii_strtod` should typically be used for reading configuration
files or other non-user input that should be locale independent.
- .. versionadded:: 2.4
-
See the Unix man page :manpage:`strtod(2)` for details.
@@ -1025,14 +982,10 @@ The following functions provide locale-independent string to number conversions.
The return value is a pointer to *buffer* with the converted string or NULL if
the conversion failed.
- .. versionadded:: 2.4
-
.. cfunction:: double PyOS_ascii_atof(const char *nptr)
Convert a string to a :ctype:`double` in a locale-independent way.
- .. versionadded:: 2.4
-
See the Unix man page :manpage:`atof(2)` for details.