[New-bugs-announce] [issue14605] Make import machinery explicit

Brett Cannon report at bugs.python.org
Tue Apr 17 17:58:05 CEST 2012


New submission from Brett Cannon <brett at python.org>:

There should no longer be any implicit part of import when there doesn't have to be. To make import fully explicit, some things need to happen (in context to importlib):

* Expose FileLoader
* Expose SourceFileLoader
* Expose PathFinder
* Expose the extension loader
* Expose the default path hook
* Explicitly set sys.meta_path with PathFinder
* Explicitly set sys.path_hooks with the default path hook and zipimport
* Make sys.path_importer_cache view None as no finder discovered
* Insert None into sys.path_importer_cache instead of NullImporter

I am not exposing SourcelessFileLoader because importlib publicly tries to discourage the shipping of .pyc files w/o their corresponding source files. Otherwise all objects as used by importlib for performing imports will become public.

----------
assignee: brett.cannon
components: Interpreter Core
messages: 158552
nosy: brett.cannon
priority: release blocker
severity: normal
status: open
title: Make import machinery explicit
type: behavior
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14605>
_______________________________________


More information about the New-bugs-announce mailing list