[patch] add pyflakes; clean up cruft
Robert Collins
robertc at robertcollins.net
Fri Jun 16 10:21:01 BST 2006
On Fri, 2006-06-16 at 15:10 +1000, Martin Pool wrote:
> This patch adds make targets to run the 'pyflakes' static checker, and
> cleans up some things I found by running it. Seeking +1 or comments.
...
> - Remove most occurrences of 'from foo import *', which is generally
> thought bad style and prevents other checks
err, I don't think is bad style per se. Its extremely useful in some
precise circumstances - such as 'from stat import *' or 'from errno
import *' - where the symbols being import are supplied from a __all__
statement, and where they make sense in the namespace they are being
imported into. Specifically, from symbol_versioning import * is useful
and appropriate, because we cannot demand load symbols needed to compile
source, only symbols used at runtime.
I can dig through the patch, but can you be more precise about what
usage of this you find objectionable?
> - Generally remove 'import bzrlib' in favour of importing the
> particular submodules that are needed.
This too - Its nice to know that 'bzrlib' is always available. If we
have 'import bzrlib.foo' then sure, import bzrlib is redudant and I
agree removing it is fine.
generally +1, would like to discuss the two points above a little more
before its merged though.
Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060616/0f7bf6f2/attachment.pgp
More information about the bazaar
mailing list