to find out. Starting with Python 2.4, a failing import of a module no longer
leaves the module in ``sys.modules``.
- .. versionchanged:: 2.6
- always use absolute imports
-
.. index:: single: modules (in module sys)
unless the the lock is hold. In the latter case the function raises an
ImportError.
- .. versionadded:: 2.6
-
.. cfunction:: PyObject* PyImport_ImportModuleEx(char *name, PyObject *globals, PyObject *locals, PyObject *fromlist)
Failing imports remove incomplete module objects, like with
:cfunc:`PyImport_ImportModule`.
- .. versionchanged:: 2.6
- The function is an alias for `cfunc:PyImport_ImportModuleLevel` with
- -1 as level, meaning relative import.
+ The function is an alias for `cfunc:PyImport_ImportModuleLevel` with -1 as
+ *level*, meaning relative import.
.. cfunction:: PyObject* PyImport_ImportModuleLevel(char *name, PyObject *globals, PyObject *locals, PyObject *fromlist, int level)
the return value when a submodule of a package was requested is normally the
top-level package, unless a non-empty *fromlist* was given.
- ..versionadded:: 2.5
-
.. cfunction:: PyObject* PyImport_Import(PyObject *name)
- 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.
-
- .. versionchanged:: 2.6
- always use absolute imports
+ This is a higher-level interface that calls the current "import hook
+ function" (with an explicit *level* of 0, meaning absolute import). 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.
.. cfunction:: PyObject* PyImport_ReloadModule(PyObject *m)
Case insensitive comparsion of strings. The functions works almost
identical to :cfunc:`strcmp` except that it ignores the case.
- .. versionadded:: 2.6
-
.. cfunction:: char * PyOS_strnicmp(char *s1, char *s2, Py_ssize_t size)
Case insensitive comparsion of strings. The functions works almost
identical to :cfunc:`strncmp` except that it ignores the case.
- .. versionadded:: 2.6
-
.. _reflection:
Wide char variant of :func:`getch`, returning a Unicode value.
- .. versionadded:: 2.6
-
.. function:: getche()
Wide char variant of :func:`getche`, returning a Unicode value.
- .. versionadded:: 2.6
-
.. function:: putch(char)
Wide char variant of :func:`putch`, accepting a Unicode value.
- .. versionadded:: 2.6
-
.. function:: ungetch(char)
Wide char variant of :func:`ungetch`, accepting a Unicode value.
- .. versionadded:: 2.6
-
.. _msvcrt-other: