Gabriel Genellina wrote: > En Fri, 09 May 2008 10:37:30 -0300, v4vijayakumar <[EMAIL PROTECTED]> > escribió: > >> On May 9, 1:48 pm, Bruno Desthuilliers <bruno. >> [EMAIL PROTECTED]> wrote: >>> v4vijayakumar a écrit : >>> >>> > When I started coding in python, these two things surprised me. >>> >>> > 1. my code is inconsistently indented with the combination of tabs and >>> > spaces. Even lines looked intended, but it is not. >>> >>> Then you have a problem with your code editor - not with Python. >>> >> >> Editors can not be wrong. :) >> >> I think there should be some way to say python compiler, to consider >> tab and two blank spaces equal, when tab space = 2. > > It already considers tab = 8 spaces, and when invoked with -tt it rejects > mixed tabs+spaces. (I would like Python rejected *any* tab used for > indenting...) > There is a tool 'reindent.py' -somewhere on your Python install-, and an > indentation checker 'tabnanny.py' (this one in the standard library). >
That's one of the reasons why I like Python :-) Still too many people don't know that you must set a TAB to 8 in your editor. Anything other than 8 for a TAB will, at some point, confuse somebody. Don't confuse indentation with TAB setting. Many editors are not helpfull either. Pydev, for example, has a setting for TAB, but it is used for indentation. It is just luck (I think) that pydev has an option to say that you only want spaces. (Take a look at the main preferences of Pydev.) So far, I have seen only one editor that understands the difference between TABs and indentation, and that is Emacs. -- Kees -- http://mail.python.org/mailman/listinfo/python-list