allow line break at operators

Chris Angelico rosuav at gmail.com
Fri Aug 12 03:09:03 EDT 2011


On Fri, Aug 12, 2011 at 2:40 AM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> Please be careful about conflating significant indentation with significant
> whitespace. Many languages have significant whitespace:
>
> foo bar
>
> is rarely the same thing as
>
> foobar
>
> but is the same as
>
> foo           bar
>
> Python is no different.
>

Of course. But most languages derived from C have a single lexer token
"whitespace". That one token is significant, but these are all the
same:

foo bar
foo               bar
foo
bar
foo/* this one wasn't originally the same*/bar

Python handles differently source files that differ only in
whitespace. It's not only indentation; newlines are whitespace too,
and they're significant. In C-derived languages, it's only
presence-or-absence.

ChrisA



More information about the Python-list mailing list