alternatives to making blocks like { } or other ??

Leif K-Brooks eurleif at ecritters.biz
Wed May 19 11:35:16 EDT 2004


Tim Williams wrote:
> I have to put my 2 cents in here. I love Python, but the one thing I
> miss is using {} or something to enclose blocks. I edit in emacs
> python-mode, and believe in indentation, but sometimes I'll
> inadvertently change a line of code's indentation and it throws the
> logic off. I found a bug in one of my programs recently where a line
> of code should have been outside of an 'if', but wasn't because I hit
> TAB one too many times. A {} block would've caught that. I know that's
> just being careless, but I need all the help I can get!

And if you came back a few months later, wouldn't you have been confused 
about what your code was doing? The beauty of Python's indentation is 
that the code does what you'll expect from looking at it.



More information about the Python-list mailing list