Parent imports inside the sub-framework could make sense, otherwise the mixture of imports might look odd. As long as it stops at ".." and doesn't include more it's relatively fine imo.
Cheers, Florian On Tuesday, November 11, 2014 10:51:19 PM UTC+1, Aymeric Augustin wrote: > > Hello, > > We’ve started using explicit relative imports in newer parts of the Django > source tree. They’re short and readable. That’s good. > > I would like to add guidelines about imports in the coding style guide in > order to improve consistency. > > My inclination would be to recommend relative imports within “components” > but avoid them between “components”, where a component is: > > - a well-defined sub-framework (django.core.cache, django.db, > django.forms, django.template, etc.) > - a contrib app > - an app in the tests/ directory > - etc. > > I would discourage going back into parent modules with relative imports > because statements such as `from ...spam import eggs` are hard to parse. > > You can see an example of this style in django.apps which has only three > files. > > What do you think? > > -- > Aymeric. > > > > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/6495326f-0588-42ff-a8b6-cb133df904e0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.