Is there an easy way to control indents in Python
alex23
wuwei23 at gmail.com
Wed Oct 15 19:51:16 EDT 2014
On 16/10/2014 12:32 AM, Chris “Kwpolska” Warrick wrote:
> It should parse this as
>
> else:
> print 'false'
> print 'done'
>
> Why? Because things like `print 'done'` usually have an empty line before it:
>
> if True:
> print 'true'
> else:
> print 'false'
>
> print 'done'
>
> That should be parsed the way you want it done. Makes perfect sense
> when you look at it.
I don't think it makes any sense at all, for two reasons:
1) Empty lines have no such semantic meaning in Python.
2) Anything that strips tabs is just as likely to strip EOLs.
More information about the Python-list
mailing list