[Python-ideas] package based import
Paul Moore
p.f.moore at gmail.com
Sun May 6 10:02:09 CEST 2012
On 6 May 2012 08:48, Ronny Pfannschmidt <Ronny.Pfannschmidt at gmx.de> wrote:
>
> the idea is to have a lookup based on package toplevel names firs, instead
> of just walking sys.path
>
> that way it becomes more natural for packages to be in a own dir instead of
> everything being merged in site-packages
> and of course, much less files to walk to find a particular package, since
> the mapping of package name to import paths is already known
>
> in order to add such ackages, some kind of registration would be necessary
This should be relatively easy to do using importlib - as a custom
meta hook (in PEP 302 terms). It could probably be written as a 3rd
party module, at least as a proof of concept.
Paul.
More information about the Python-ideas
mailing list