Mercurial > cpython-lru_cache-weakref
annotate Doc/library/importlib.rst @ 54294:dba767bc3155 legacy-trunk
remove mention of old ctypes version
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Sat, 23 May 2009 20:59:09 +0000 |
| parents | b4ace2b6c28f |
| children | baa98ba85fd4 |
| rev | line source |
|---|---|
|
51055
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
1 :mod:`importlib` -- Convenience wrappers for :func:`__import__` |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
2 =============================================================== |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
3 |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
4 .. module:: importlib |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
5 :synopsis: Convenience wrappers for __import__ |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
6 |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
7 .. moduleauthor:: Brett Cannon <brett@python.org> |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
8 .. sectionauthor:: Brett Cannon <brett@python.org> |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
9 |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
10 .. versionadded:: 2.7 |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
11 |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
12 This module is a minor subset of what is available in the more full-featured |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
13 package of the same name from Python 3.1 that provides a complete |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
14 implementation of :keyword:`import`. What is here has been provided to |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
15 help ease in transitioning from 2.7 to 3.1. |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
16 |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
17 |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
18 .. function:: import_module(name, package=None) |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
19 |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
20 Import a module. The *name* argument specifies what module to |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
21 import in absolute or relative terms |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
22 (e.g. either ``pkg.mod`` or ``..mod``). If the name is |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
23 specified in relative terms, then the *package* argument must be |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
24 specified to the package which is to act as the anchor for resolving the |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
25 package name (e.g. ``import_module('..mod', 'pkg.subpkg')`` will import |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
26 ``pkg.mod``). The specified module will be inserted into |
|
b4ace2b6c28f
Backport importlib in the form of providing importlib.import_module(). This has
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
27 :data:`sys.modules` and returned. |
