how to reduce bugs due to incorrect indentation

Terry Reedy tjreedy at udel.edu
Thu Feb 6 09:09:01 CET 2014


On 2/5/2014 10:02 PM, msustik at gmail.com wrote:

> if a == 1:
>      x = y
> else:
>      x = z
> y = z + y
> z = z + 1
>
> While editing this file I accidentally pushed TAB on the line with 'y = z + y'.

In this particular case, remove the indentation with
x = y if a == 1 else z
and indenting the next line is  syntax error.
-- 
Terry Jan Reedy




More information about the Python-list mailing list