On 04/01/2008, Joseph Armbruster <[EMAIL PROTECTED]> wrote:
> Cool I suppose, except here's an odd man out:
>
> >>> 1.__str__()
>    File "<stdin>", line 1
>      1.__str__()
>              ^
>  SyntaxError: invalid syntax

It's parsed a floating point number - "1." - followed by the keyword
"__str__". That's not valid.

>  >>> 1 .__str__()
>  '1'

This one is a number "1" followed by the operator "." followed by "__str__".

The lexer reads the longest valid token each time.
Paul.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to