[Idle-dev] A little improvement on identation

João Paulo Silva s.joaopaulo at gmail.com
Fri Oct 21 08:48:58 CEST 2005


Hi all (first post here),

Last month I'd seen a introductory article about Python in a magazine.
At some part, the author said to be careful with identation, and wrote
that example (on interactive mode):

Do that:
>>> def foo():
             pass

Don't do:
>>> def foo():
  pass

Of course both methods are correct. I believe he was using IDLE. The
"pure text" interactive mode would use:

>>> def foo():
...         pass # Perhaps the font is not helping to see.

So, mainly for beginners (I believe for everyone), the IDLE
interactive mode could work like the "pure text" mode. The '...' is
very useful to maintain the identation, and the code becomes easier to
read and write.

--
João Paulo da Silva

(Sorry any english errors...)


More information about the IDLE-dev mailing list