[Python-ideas] Avoid circular import

Sven Marnach sven at marnach.net
Tue Apr 10 16:53:01 CEST 2012

Oleg Broytman schrieb am Tue, 10. Apr 2012, um 18:11:05 +0400:
> > This issue can be easily overcome with function-level imports, but
> > some people don't like function-level imports either.
>    Can I say I doubt it's a good reason to change Python?

Sorry, I actuually didn't mean to argue in favour of any proposal.  I
just meant to point out issues relevant to this thread that some
people probably are not aware of.

> > The same issue turned up when porting the Python Imaging Library to
> > Python 3.  PIL uses implicit relative, circular imports which have to
> > be turned into function-level imports to work properly on Python 3,
> > see [2] for details.
> > 
> > [2]: https://github.com/sloonz/pil-py3k/pull/2
>    Was there any major problem in fixing that?

This was meant as an example that these issues arise in practice, even
in libraries that can hardly be cosidered obscure.


More information about the Python-ideas mailing list