allow line break at operators

Yingjie Lan lanyjie at yahoo.com
Thu Aug 11 09:24:24 CEST 2011


________________________________
From: Steven D'Aprano <steve+comp.lang.python at pearwood.info>
To: python-list at python.org
Sent: Thursday, August 11, 2011 12:18 PM
Subject: Re: allow line break at operators

On Thu, 11 Aug 2011 12:52 pm Yingjie Lan wrote:

> :And if we require {} then truly free indentation should be OK too! But
> 
> :it wouldn't be Python any more.
> 
> Of course, but not the case with ';'. Currently ';' is optional in Python,
> But '{' is used for dicts. Clearly, ';' and '{' are different in
> magnitude.
> 
> So the decision is: shall we change ';' from optional to mandatory
> to allow free line splitting?

:Why on earth would you want to break backwards compatibility of millions of
:Python scripts and programs, and require extra, unnecessary line-noise on
:every single line of Python code, just so that you can occasionally avoid a
:writing a pair of parentheses?

I think allowing free line splitting (without parentheses -- that's artifitial and 
requires the coder to serve the machine rather than the other way around)
with proper indentation will produce truely ergonomic code layout (well,
assuming you also like properly indented code). 

And this can be done almost hassle-free for the coder. 

The compatibility problem can be solved by something like a preprocessor 
indicator to opt in this new language feature, or, if we are determined to favor
this new feature, all old code can be easily converted. The worst case is
that the coder has to opt in.

The trouble of adding a ';' to most of the lines can also be 
avoided by a smart editor (see my other reply).

Python serves the coder, not the other way around. 

Cheers,

Yingjie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110811/0e67b75f/attachment.html>


More information about the Python-list mailing list