[Zope-dev] Coding style clarifications

Zvezdan Petkovic zvezdan at zope.com
Thu Feb 19 11:23:13 EST 2009


On Feb 19, 2009, at 11:03 AM, Jim Fulton wrote:
> I sort my imports.  Period. This makes from imports come before
> regular imports (because f comes before i).  I discourage from
> imports, so this isn't much of an issue for me except for old code.
> Having imports sorted takes very little effort and makes imports
> easier to find and duplicated easier to spot. Grouping imports makes
> imports harder to maintain and read, especially since groupings are
> arbitrary unless they follow package boundaries, and just sorting
> imports groups imports by package boundaries.

Exactly .  As I mentioned in the previous post, sorting is the *key*  
here.  [Pun intended].
Grouping (python, zope., myapp. modules order), or non-grouping,  
becomes a non-issue when imports are sorted.

+1

> BTW, I strongly discourage from imports. (I didn't always have this
> opinion, but have seen the error of my ways. Thanks to Fred Drake for
> nudging me in this direction.) IMO, this is wildly more important than
> any of the issues raised in this thread.

Very important for code maintenance/readability!
+1

	Zvezdan



More information about the Zope-Dev mailing list