[Python-Dev] Re: PEP239 (Rational Numbers) Reference Implementation and new issues

Greg Ewing greg@cosc.canterbury.ac.nz
Tue, 08 Oct 2002 14:23:44 +1300 (NZDT)


Brian Quinlan <brian@sweetapp.com>:

> Is that going to be easy to parse?
> 
> >>> 1 <5/2> -3
> 1

Yes, but

>>> 1 + <5/2> * -3
  File "<string>", line 1
    1 + <5/2> * -3
        ^
SyntaxError: invalid syntax

When used as a rational literal, the <...> will always
have some operator separating it from any adjacent
expression.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg@cosc.canterbury.ac.nz	   +--------------------------------------+