[Python-Dev] PEP 328 and import contract (original) (raw)

Samuele Pedroni pedronis at bluewin.ch
Tue May 11 15:45:00 EDT 2004


PEP 328 seems at the moment to only describe the syntactic, surface and as-seen-by-the-user aspects of the new behavior for absolute/relative imports.

What is going to happen to import hook?

At the moment relative imports as the default are implemented at that level, through get_parent and the first load_next in import_module_ex which is exported as import.

Will imports still be implemented in terms of/on top of import.

What will be the contract for import then? I suppose it could be kept the same, relaxing over time the obligation to implement relative imports. At the moment a import hook can be forced in absolute import mode by passing an empty globals dict.

I think the PEP should cover some of this.

regards.



More information about the Python-Dev mailing list