Tabnanny really useful?

Franz Steinhaeusler franz.steinhaeusler at utanet.at
Tue Dec 21 09:21:48 EST 2004


On Tue, 21 Dec 2004 08:36:31 -0500, Steve Holden <steve at holdenweb.com>
wrote:

>Franz Steinhaeusler wrote:
>
>[...]
>> 
>> Oh sorry, I meant
>> def a():
>> ->print
>> ..->print
>> 
>> C:\Python23\Lib>tabnanny.py -v c:\franz.py
>> 'c:\\franz.py': *** Line 3: trouble in tab city! ***
>> offending line: ' \tprint\n'
>> indent not equal e.g. at tab size 1
>> 
>> C:\Python23\Lib>python -c "print repr(open('c:/franz.py').read())"
>> 'def a():\n\tprint\n \tprint\n'
>> 
>> C:\Python23\Lib>c:/franz.py
>> 
>> C:\Python23\Lib>
>
>Well, you've probably answered your own question, then. Do you think 
>tabnanny is a useful piece of code now? 

Not really soo useful, because most syntax and also indentation errors
are actually detected by invoking python, i.e. the command compile.
But as combination for this: yes why not.
I looked for Stanis spe editor, which uses a combination of these two.

The background is:

I'm a member of the wxPython project Drpython (Python text editor 
and much more), and wanted also check the usefulness of a kind of syntax
check, which should run, before saving a Python file.
PythonCard Codeeditor also uses tabnanny, as far as i can remember.

>[...]

regards
-- 
Franz Steinhaeusler



More information about the Python-list mailing list