[Python-ideas] allow line break at operators

Daniel Greenfeld pydanny at gmail.com
Thu Aug 11 19:04:24 CEST 2011


Something like this already exists:

a = 0
b = 1
if (True == True
        and False == False
        and a + 1 == b
        and b - 1 == a):
        print 'meh'

So I've got no idea what this proposal is about except for the
dropping of readability of Python.

-1

Daniel Greenfeld

On Thu, Aug 11, 2011 at 8:42 AM, Jakob Bowyer <jkbbwr at gmail.com> wrote:
> -1 This idea seems like it would remove the true readability of
> python. Personally it would create more confusion than it would
> remove.
>
> On Thu, Aug 11, 2011 at 3:28 PM, Matt Joiner <anacrolix at gmail.com> wrote:
>> +0.5
>>
>> The "trailing \" workaround is nonobvious. Wrapping in () is noisy and
>> already heavily used by other syntactical structures. Since a final
>> ':' is needed anyway, i think this would be great.
>>
>> if a
>>  and b
>>  or c:
>>  do stuff()
>>
>> On Thu, Aug 11, 2011 at 11:02 PM, MRAB <python at mrabarnett.plus.com> wrote:
>>> On 11/08/2011 05:16, Chris Rebert wrote:
>>>>
>>>> On Wed, Aug 10, 2011 at 7:52 PM, Yingjie Lan<lanyjie at yahoo.com>  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,
>>>>
>>>> I think of it more as that Python deigns to permit semicolons.
>>>>
>>>>> 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?
>>>>
>>>> Hell no, considering that the sizable majority of lines *aren't*
>>>> split, which makes those semicolons completely redundant to their
>>>> accompanying newlines. We'd be practicing poor Huffman coding by
>>>> optimizing for the *un*common case. It would also add punctuational
>>>> noise to what is otherwise an amazingly clean and readable syntax.
>>>> Accidental semicolon omission is (IMO) the most irritating source of
>>>> syntax (and, inadvertently, sometimes other more serious) errors in
>>>> curly-braced programming languages.
>>>>
>>> +1
>>>>
>>>> Such a core syntax feature is not going to be changed lightly (or likely
>>>> ever).
>>>>
>>> I'm glad to hear that. :-)
>>>
>>> Although Python's use of indentation has its downside, we gain much
>>> more then we lose, IMHO.
>>> _______________________________________________
>>> Python-ideas mailing list
>>> Python-ideas at python.org
>>> http://mail.python.org/mailman/listinfo/python-ideas
>>>
>> _______________________________________________
>> Python-ideas mailing list
>> Python-ideas at python.org
>> http://mail.python.org/mailman/listinfo/python-ideas
>>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>



More information about the Python-ideas mailing list