allow line break at operators

Yingjie Lan lanyjie at yahoo.com
Thu Aug 11 03:53:55 EDT 2011


________________________________
From: Chris Rebert <clp2 at rebertia.com>
To: Yingjie Lan <lanyjie at yahoo.com>
Cc: "python-list at python.org" <python-list at python.org>
Sent: Thursday, August 11, 2011 3:50 PM
Subject: Re: allow line break at operators

On Thu, Aug 11, 2011 at 12:24 AM, Yingjie Lan <lanyjie at yahoo.com> wrote:
> From: Steven D'Aprano <steve+comp.lang.python at pearwood.info>
> 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.
<snip>
> The trouble of adding a ';' to most of the lines can also be
> avoided by a smart editor (see my other reply).

:The trouble of dealing with long lines can be avoided by a smart
:editor. It's called line wrap.

Yeah, usually they just wrap it pretty arbitrarily, 
and you don't have any control, isn't it?

Cheers,

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


More information about the Python-list mailing list