[Tutor] PyChecker: Installing and or Using

Dick Moores rdm at rcblue.com
Thu Aug 11 16:17:03 CEST 2005


Kent Johnson wrote at 05:31 8/11/2005:
>According to the docs importing pychecker only checks modules that are 
>imported *after* the module containing the import. If you have a 
>single-file program try using pychecker from the command line.
>
>When you insert errors as a test, of course you have to use errors that 
>are more subtle than syntax errors - things that would cause runtime 
>errors. For example:
>
>def f():
>   x = y
>
>Kent

OK, thanks, Kent. Thanks for sticking with me. Finally got it working. I 
ran pychecker on mycalc.py and got what looks like a lot of useful 
feedback (I put your function is at the top; line 3 is your "x = y"):

====================================
C:\Python24>lib\site-packages\pychecker\checker.py mycalc.py
Processing mycalc...

Warnings...

mycalc.py:3: Local variable (x) not used
mycalc.py:3: No global (y) found
mycalc.py:9: (max) shadows builtin
mycalc.py:9: (min) shadows builtin
mycalc.py:16: (min) shadows builtin
mycalc.py:18: (min) shadows builtin
mycalc.py:24: (max) shadows builtin
mycalc.py:42: No global (regularizeFirstGroup) found
mycalc.py:46: No global (computeIllionNum) found
mycalc.py:47: No global (illionNumToName) found
mycalc.py:49: No global (stripZeros) found
mycalc.py:55: Function returns a value and also implicitly returns None
mycalc.py:148: (max) shadows builtin
mycalc.py:171: Module (mycalc) imports itself
mycalc.py:260: Module (mycalc) imports itself

C:\Python24>
==================================

Dick








More information about the Tutor mailing list