From D

Kay Schluehr kay.schluehr at gmx.net
Thu Jul 26 21:42:44 CEST 2007


On Jul 25, 7:22 pm, "mensana... at aol.com" <mensana... at aol.com> wrote:
> On Jul 24, 6:08 pm, Steven D'Aprano
>
>
>
> <st... at REMOVE.THIS.cybersource.com.au> wrote:
> > On Tue, 24 Jul 2007 20:09:00 +0200, Bjoern Schliessmann wrote:
> > > Stargaming wrote:
> > >> On Tue, 24 Jul 2007 03:19:53 -0700, bearophileHUGS wrote:
>
> > >>> While in a syntax like:
> > >>> for i in xrange(1_000_000):
> > >>> my eyes help me group them at once.
>
> > >> Sounds like a good thing to be but the arbitrary positioning
> > >> doesnt make any sense.
>
> > > Checking underscore positions would only add complexity. Why not
> > > just ignore them, no matter where they are?
>
> > Underscores in numerics are UGLY. Why not take a leaf out of implicit
> > string concatenation and allow numeric literals to implicitly concatenate?
>
> > Python already does:
> > "hello-" "world" => "hello-world"
>
> > Propose:
> > 123 456 789 => 123456789
> > 123.456 789 => 123.456789
>
> So, spaces will no longer be delimiters? Won't that cause
> much wailing and gnashing of teeth?

Nope. Just replace the current grammar rule

atom: ... NAME | STRING+ | NUMBER

by

atom: ... NAME | STRING+ | NUMBER+

The resulting grammar is still free of ambiguities. The tokenizer
doesn't complain anyway - not even yet.




More information about the Python-list mailing list