namespaces & indentation
rcameszREMOVETHIS at dds.removethistoo.nl
Sat Dec 23 11:43:07 CET 2000
Tim Peters wrote:
>1. Strive to test all paths thru each function (good advice
>regardless of language).
>2. It's likely that a framework for warning messages will be added
>to Python 2.1. In the case above, the compiler could do some flow
>analysis and generate a compile-time warning that "c" may not be
>bound at the time the "return" is executed. Java's rules make that
>kind of code a compile-time error, but some people play such extreme
>tricks with Python's dynamicism that we'll probably have to settle
>for a nag msg in Python.
It seems to me you're making a good case for a Python-Lint program.
There are many examples like these floating around, for instance when
you should write self.SomeVar but accidentally drop the .self in a
member function it won't be considered an error, even if self.SomeVar
appears somewhere else in the class. All these technically valid but
probably erroneous pieces of code could be flagged by a Lint program
without burdening Python's bytecode-compiler.
>if-thine-eye-offends-thee-pluck-it-out-ly y'rs - tim
As the saying goes: don't cut off your nose to spite your face.
More information about the Python-list