Py3K idea: why not drop the colon?
Michael Hobbs
mike at hobbshouse.org
Mon Nov 13 13:30:59 EST 2006
Ron Adam wrote:
> skip at pobox.com wrote:
>
>> >>>>> I'm not sure why '\'s are required to do multi-line before the colon.
>> >>>> Special cases aren't special enough to break the rules.
>> >>>>
>> >>>> Georg
>> >>> A bit of a circular answer.
>> >>>
>> >>> Why the rule? -> So not to break the rule?
>> >>
>> >> You proposed to allow leaving off line continuation '\' only in the
>> >> "if", "for" and "while" headers. This is a special case in my eyes.
>>
>> Ron> I wasn't that specific and it was related to Michael's suggestion
>> Ron> the colon wasn't needed. If the need for '\' was dropped in
>> Ron> multi-line block headers, then the colon would be required for an
>> Ron> obvious reason.
>>
>> But \ is used to continue all sorts of statements/expressions, e.g.:
>>
>> x = a + \
>> b
>>
>> not just conditionals.
>>
>> Skip
>>
>
> Of course, and your point is?
>
> How about if it be ok to continue to use '\' in headers, but it also be ok to
> not to? That would be the backward compatible way to change it.
>
> This doesn't answer the question I was asking, are there any situation where it
> would cause problems? And if so, that reason would be a good and explicit
> reason for not making such a change
To be clear, this is the actual thrust of my argument. It seems
redundant to have *both* line continuations and colons in compound
statements. I've been arguing for the removal of colons, though to be
honest, I'd be content with the opposite approach as well.
- Mike
More information about the Python-list
mailing list