[patch] add pyflakes; clean up cruft

Martin Pool mbp at canonical.com
Tue Jun 20 01:00:44 BST 2006


On 19 Jun 2006, Andrew Bennetts <andrew at canonical.com> wrote:
> I guess strictly speaking it is a pyflakes bug, but a hard one to fix 100%
> correctly.
> 
> The basic problem is that python does almost everything at runtime, including
> imports and definitions, and so pyflakes can't cover all cases because it
> doesn't actually execute the code, just inspect the compiled code.

(Nice post.)

Right, so proper static checking is impossible in general.  But it is
very handy, and most Python code is written in a stylized quasi-static
way, and we can try to meet the tools halfway.

When I'm writing C or C++ I sometimes change the code purely to please
the warning checker, even if the original was (arguably) equally clear
and correct.  There's nothing wrong in other languages with writing code
that's likely to be safe *with the tools you have available* but because
checkers are not so well established in Python we don't tend to have
that habit.

-- 
Martin




More information about the bazaar mailing list