lazy import aware branch of pyflakes

John Arbash Meinel john at arbash-meinel.com
Thu Feb 28 00:13:14 GMT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michael Hudson wrote:
| John Arbash Meinel wrote:
|> -----BEGIN PGP SIGNED MESSAGE-----
|> Hash: SHA1
|>
|> Michael Hudson wrote:
|> | I got tired of cleaning up the imports of a couple of bzrlib files by
|> | hand or by converting lazy imports to real imports, running pyflakes
|> | and then lazifying the imports again, so I came up with a better way:
|> | hacking pyflakes to understand lazy imports.
|> |
|> | The branch at:
|> |
|> |
|> https://code.edge.launchpad.net/~mwhudson/pyflakes/lazy-import-support
|> |
|> | does three things:
|> |
|> | 1) Parses lazy imports so that uses of the imported names don't give
|> |    'undefined name' warnings.
|> | 2) Warns if a lazily imported name is used at module level.
|> | 3) Warns for names that are imported eagerly but *not* used at module
|> |    level and so could be lazy.
|>
|> Sounds nice.
|
| Thanks.
|
|> |
|> | It produces rather a for bzrlib currently (though some of it is noise:
|> | pyflakes complains at this sort of thing:
|>
|> Rather a ???
|
| I don't understand your comment here -- are you just saying that you
| don't understand my comment? :)

"It produces rather a for bzrlib" is missing a noun.

...

|> Also thanks for doing this. We might consider adding it to the test
|> suite (part
|> of our source tests), but we would need to get it clean first.
|
| I don't know how feasible that is -- one idea is to have a ratchet,
| which says that each commit much not increase the number of pyflakes
| complaints, or something.
|
| Cheers,
| mwh
|


Yeah, and with most lint programs there are usually times when they are
specifically wrong for one reason or another.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHxfyaJdeBCYSNAAMRAuiXAKC9V6QW9KUAx8PfZW+QGBZIHhv8OgCcD/9j
NIajWRUheYi3mLOTt9mLfok=
=2Jsb
-----END PGP SIGNATURE-----



More information about the bazaar mailing list