[Python-Dev] relative import circular problem

Nick Coghlan ncoghlan at gmail.com
Thu Apr 4 15:01:46 CEST 2013

On 4 Apr 2013 19:37, "Kristján Valur Jónsson" <kristjan at ccpgames.com> wrote:
> > -----Original Message-----
> > From: Eric Snow [mailto:ericsnowcurrently at gmail.com]
> > Sent: 4. apríl 2013 04:57
> > > imported by both of the original modules. At that point, the code is
> > > cleaner and more decoupled, and the uneven circular import support
> > ceases to be a problem for that application.
> >
> > +1
> I tried to make the point in an earlier mail that I don't think that we
ought to let our personal opinions de-jour on software architecture put a
constraint on our language features.
> There can be good and valid reasons to put things that depend on each
other in separate modules, for example when trying to separate modules by
functionality or simply when splitting a long file into two.
> Notice that cyclic dependencies are allowed _within_ a module file.
 Imagine if we decided that we could only refer to objects _previously_
 declared within a .py file, because it encouraged the good design practice
of factoring out common dependencies.
> Dependency graphs of software entities can sadly not always be reduced
into a DAG, and we should, IMHO, by no means force people to keep each
cygle in the dependency graph within a single .py module.

That's why it's just a reason none of the current import system devs are
inclined to work on it, rather than a reason for rejecting proposals and
tested patches that give improved behaviour.


> K
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130404/31867697/attachment.html>

More information about the Python-Dev mailing list