allow line break at operators

Neil Cerutti neilc at norwich.edu
Thu Aug 11 16:40:21 CEST 2011


On 2011-08-10, Chris Angelico <rosuav at gmail.com> wrote:
> On Wed, Aug 10, 2011 at 10:51 PM, Ben Finney <ben+python at benfinney.id.au> wrote:
>> Seebs <usenet-nospam at seebs.net> writes:
>>> I've seen bits of code in preprocessing-based "Python with {}" type
>>> things, and they still look like Python to me, only they favor
>>> explicit over implicit a little more strongly.
>>
>> They introduce unnecessary ambiguity: the indentation-as-structure and
>> braces-as-structure can then disagree.
>>
>> The ambiguity is resolved by having exactly one of indentation or braces
>> determining structure: Python uses indentation. In which case, braces
>> are pointless for indicating block structure.
>
> That's why it wouldn't be Python. It would have to use the braces and
> not the indentation.
>
> ChrisA
> PS. I mistakenly sent this to a Gilbert & Sullivan group first. Oddly
> enough, opera-goers are not used to discussing the relative merits of
> braces vs indentation in code.

Had I not become a lover of semantic indentation,
Wisely wielding willing whitespace in a wondrous preparation,
I could buttress blocks with braces, a la Kernighan and Ritchie,
(Other styles, just as valid, make me terri-bul-ly twitchy),
What I noticed was the whitespace hasn't shifted one iota,
With the braces superfluous in my wc -m quota,
When delineating code-blocks, with my keys a-clitter-clatter,
I prefer semantic whitespace 'cause the braces shouldn't matter.
No, the braces shouldn't matter,
(Matter, matter, matter, matter)
No, the braces shouldn't matter,
(Matter, matter, matter, matter)
When delineating code-clocks, with my keys a-clitter-clatter,
I prefer semantic whitespace 'cause the braces shouldn't matter.

-- 
Neil Cerutti



More information about the Python-list mailing list