Indentation/whitespace

Jon Perez jbperez808 at yahoo.com
Wed Jan 11 22:56:05 EST 2006


thakadu wrote:

> While I have no doubt that there are lousy browsers out there, the
> problem is not only with browsers, but also I agree with you its not
> Python's fault. The issue is that the code I am pasting may have used a
> DIFFERENT indentation scheme, so lets say I used four spaces and the
> code I am pasting used two spaces, or worse yet, a tab, that is where
> the problem arises. Now assuming that the browser and the copy and
> paste buffers dont screw up the indentation, when I paste that code
> into my editor that is where the problem arises. Sure if everyone stuck
> to the recommended 4 spaces in the style guide it would help. But even
> then in the context of your program you may be a further level of
> indentation.

Although the below does work, I believe:

def fun1():
  print "I use two space indentation"
  while (1):
      print "but"
      print "four space works just as well"
      print "and can coexist"


It just has to be consistent within a *single* block.




More information about the Python-list mailing list