[PATCH 0 of 6] Fix problems found by Pyflakes

Florent Guillaume fg at nuxeo.com
Wed Mar 5 15:06:27 UTC 2008


Bryan O'Sullivan wrote:
> Joel Rosdahl wrote:
> 
>> A possibly controversial thing about the first patch is that it
>> removes the import of everything in mercurial.node/mercurial.repo from
>> mercurial/hg.py, which means that mercurial.node/mercurial.repo stuff
>> won't be importable from mercurial.hg anymore.
> 
> What's the reason for this?  It seems to make the patch much more
> intrusive, without providing any benefit in readability.

I agree with Joel that transitive imports hide the meaning of things.
Better always import from the module that defines something.

>> In addition to enabling Pyflakes checking, I also think it's good
>> style to avoid "star imports".
> 
> Yes, star imports are almost always bad.

+1 on this too.

Florent

-- 
Florent Guillaume, Director of R&D, Nuxeo
Open Source Enterprise Content Management (ECM)
http://www.nuxeo.com   http://www.nuxeo.org   +33 1 40 33 79 87



More information about the Mercurial-devel mailing list