import in Python3.3

Rocky Bernstein rocky at
Tue Mar 26 23:24:02 CET 2013

On Tue, Mar 26, 2013 at 5:16 PM, Phil Connell <pconnell at> wrote:

> On Tue, Mar 26, 2013 at 08:37:00AM -0700, rocky wrote:
> > And again, I get the impression that for the use case asked about, there
> isn't much ambiguity. If I am in and I want to access
> mypackage.collections I should be able to say something like that without
> ambiguity or that much inference or directory searching. If
> mypackage.colletions is not found inside the same directory as
>, often I DON'T WANT Python to helpfully go searching around
> other places for it which sys.path will do. Instead what I probably want is
> Python to give me an error.
> >
> > So again I come to import_relative,
>  And again, I wish this
> package didn't have to exist.
> What's wrong with PEP 328 relative imports?

They've never worked for me. Some details are mentioned that in the link

If it works for you, great, use it.

> In, use
>     from . import collections
> to import mypackage.collections.
> This has been part of the language since ~2.5
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list