[PEP 451] Don't change the signature of the file-based finders.
The "Open Issues" section is also cleaned up.
This commit is contained in:
parent
834123996b
commit
d57c8be816
39
pep-0451.txt
39
pep-0451.txt
|
@ -278,8 +278,9 @@ finders. See the `Factory Functions`_ section below for more detail.
|
|||
|
||||
* spec_from_file_location(name, location, \*, loader=None, submodule_search_locations=None)
|
||||
- build a spec from file-oriented information and loader APIs.
|
||||
* from_loader(name, loader, \*, origin=None, is_package=None) - build
|
||||
a spec with missing information filled in by using loader APIs.
|
||||
* spec_from_loader(name, loader, \*, origin=None, is_package=None)
|
||||
- build a spec with missing information filled in by using loader
|
||||
APIs.
|
||||
|
||||
Other API Additions
|
||||
-------------------
|
||||
|
@ -313,8 +314,6 @@ Deprecations
|
|||
* importlib.abc.PathEntryFinder.find_loader()
|
||||
* importlib.abc.Loader.load_module()
|
||||
* importlib.abc.Loader.module_repr()
|
||||
* The parameters and attributes of the various loaders in
|
||||
importlib.machinery
|
||||
* importlib.util.set_package()
|
||||
* importlib.util.set_loader()
|
||||
* importlib.find_loader()
|
||||
|
@ -756,12 +755,6 @@ though the same information is found on ModuleSpec. ModuleSpec
|
|||
can use it to populate its own is_package if that information is
|
||||
not otherwise available. Still, it will be made optional.
|
||||
|
||||
One consequence of ModuleSpec is that loader ``__init__`` methods will
|
||||
no longer need to accommodate per-module state. The path-based loaders
|
||||
in importlib take arguments in their ``__init__()`` and have
|
||||
corresponding attributes. However, the need for those values is
|
||||
eliminated by module specs.
|
||||
|
||||
In addition to executing a module during loading, loaders will still be
|
||||
directly responsible for providing APIs concerning module-related data.
|
||||
|
||||
|
@ -775,11 +768,10 @@ Other Changes
|
|||
was started. For instance, with ``-m`` the spec's name will be that
|
||||
of the run module, while ``__main__.__name__`` will still be
|
||||
"__main__".
|
||||
* We add importlib.find_spec() to mirror
|
||||
importlib.find_loader() (which becomes deprecated).
|
||||
* We will add importlib.find_spec() to mirror importlib.find_loader()
|
||||
(which becomes deprecated).
|
||||
* importlib.reload() is changed to use ModuleSpec.load().
|
||||
* importlib.reload() will now make use of the per-module import
|
||||
lock.
|
||||
* importlib.reload() will now make use of the per-module import lock.
|
||||
|
||||
|
||||
Reference Implementation
|
||||
|
@ -792,10 +784,19 @@ http://bugs.python.org/issue18864.
|
|||
Open Issues
|
||||
==============
|
||||
|
||||
\* The impact of this change on pkgutil (and setuptools) needs looking
|
||||
into. It has some generic function-based extensions to PEP 302. These
|
||||
may break if importlib starts wrapping loaders without the tools'
|
||||
knowledge.
|
||||
\* Impact on some kinds of lazy loading modules. [lazy_import_concerns]_
|
||||
|
||||
This should not be an issue since the PEP does not change the semantics
|
||||
of this behavior.
|
||||
|
||||
|
||||
Implementation Notes
|
||||
====================
|
||||
|
||||
\* The implementation of this PEP needs to be cognizant of its impact on
|
||||
pkgutil (and setuptools). pkgutil has some generic function-based
|
||||
extensions to PEP 302 which may break if importlib starts wrapping
|
||||
loaders without the tools' knowledge.
|
||||
|
||||
\* Other modules to look at: runpy (and pythonrun.c), pickle, pydoc,
|
||||
inspect.
|
||||
|
@ -803,8 +804,6 @@ inspect.
|
|||
For instance, pickle should be updated in the ``__main__`` case to look
|
||||
at ``module.__spec__.name``.
|
||||
|
||||
\* Impact on some kinds of lazy loading modules. [lazy_import_concerns]_
|
||||
|
||||
|
||||
References
|
||||
==========
|
||||
|
|
Loading…
Reference in New Issue