Py3K idea: why not drop the colon?

Ron Adam rrr at ronadam.com
Sun Nov 12 01:23:20 EST 2006


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.

Ron





More information about the Python-list mailing list