pychecker should be mentioned in every tutorial [Re: How to avoid "f.close" (no parens) bug?]
DH
no at spam.edu
Wed Feb 11 14:59:19 EST 2004
> Stephen> I've just spent several very frustrating hours tracking down a
> Stephen> bug in one of my programs. The problem was that I was writing
> Stephen> text to a file, and when I was done I coded
>
> Stephen> f.close
>
> Stephen> when I should have been coding
>
> Stephen> f.close()
>
> Stephen> with the parentheses.
>
> Stephen> In any event, does anybody have any suggestions for how a coder
> Stephen> could avoid making such a mistake, or detect it quickly?
>
> Pychecker would probably have warned about this. Given this four-line file:
There are numerous common mistakes people making when coding in Python
that the compiler doesn't catch. Case-sensitive errors, errors in
indenting, etc.
I think PyChecker ( http://pychecker.sf.net/ ) should be mentioned in
every beginner tutorial, and should be integrated with every Python IDE.
Before you type anything, type "import pychecker.checker"
More information about the Python-list
mailing list