A modest indentation proposal
Erann Gat
gat at jpl.nasa.gov
Sat Dec 1 02:06:16 EST 2001
In article <WBUN7.9250$FP6.336989 at atlpnn01.usenetserver.com>, "Steve
Holden" <sholden at holdenweb.com> wrote:
> Perhaps it wouldn't be "illegal". I think the point was that there may well
> be existing Python programs which are currently syntactically correct whose
> meaning would be altered by the adoption of your rule. If under present
> syntax I write
>
> def a(x,y):
> stm1
> stm2
> stm3;
>
> this is currently legal Python in which stm3 is not a part of the function
> body. Would your rule treat this as a syntax error, or observe the
> indentation and accept it? Or something else?
It would, if the 'activate-paranoid-indentation-mode' flag were enabled,
signal a syntax error, or if that's unacceptable, issue a warning, e.g.
"Warning: the block structure defined by indentation does not match that
implied by punctuation. Check your indentation." Or something like that.
BTW, I am assuming that there's not a huge installed base of Python code
with trailing semicolons (since they're useless at the moment).
E.
More information about the Python-list
mailing list