Why whitespace denotation of blocks doesn't work.

Mike Steed MSteed at altiris.com
Tue Jun 20 12:21:30 EDT 2000


> From: ted.drain at jpl.nasa.gov [mailto:ted.drain at jpl.nasa.gov]
> Sent: Tuesday, June 20, 2000 9:33 AM
> To: python-list at python.org
> Subject: Re: Why whitespace denotation of blocks doesn't work.
> 
> 
> The one thing that I really hate about the white space blocking is when
> you have to reformat because of a code change.  This is something that has
> hit me quite a few times.  
> 
> I'll write some code, and as I start debugging/prototyping/etc etc, I find
> that I have to enclose some existing code in a control block (if,etc). 
> With C/C++, I just put the code in brace, tell xemacs to re-indent the
> block, and everything's good.  With Python, I have to hand edit everything
> because the editor can't figure out how to do the indentation after I've
> inserted the control block.  Once you get a few nested indentation blocks,
> this gets very confusing and leads to bugs that are hard to find (code
> that did work suddenly doesn't).

In Vim it is easy to select a block of code and shift it in or out one
'shiftwidth'.  I don't know emacs, but I would be surprised if it did not
provide a similar facility.

> I love Python, but I'd really prefer to have open/close 
> brackets for the blocks.
> 
> Ted

--
M.




More information about the Python-list mailing list