import relative (with a directory)

Kay Schluehr kay.schluehr at gmx.net
Sun Jan 11 00:32:34 EST 2009


On 11 Jan., 03:27, Chris Rebert <c... at rebertia.com> wrote:

> You should probably check out the relative import syntax introduced in
> PEP 328:http://www.python.org/dev/peps/pep-0328/
> It should be able to do exactly what you want.

This should exactly lead to exceptions in all of his demo code because
the modules are not "scripts" anymore but "modules in a package" - a
semantical difference I wasn't even aware of until relative imports
were introduced in Python 2.5.

I'd rather avoid the sour grapes and use absolute imports.

Kay



More information about the Python-list mailing list