|
From: <bc...@wo...> - 2001-08-31 14:08:04
|
[Tim Peters] >Hi -- I'm about to check in a change to Python's float literal syntax: > >http://sf.net/tracker/?func=detail&atid=305470&aid=455966&group_id=5470 > >Currently, CPython doesn't allow a float or imag literal to begin with a >string of digits that "looks like" an octal literal, except for the specific >prefix "0.". Things like > > 00.0 > 0e3 > 0100j > 09.5 > >are all rejected as SyntaxErrors. After the patch, those are all accepted. > >Will this create problems for Jython? No. Jython can handle some of these already: Jython 2.1a3 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> 00.0 0.0 >>> 0e3 0.0 >>> 0100j Traceback (innermost last): (no code object) at line 0 File "<console>", line 1 0100j ^ SyntaxError: invalid syntax >>> 09.5 9.5 >>> The failing one is as easy to fix as it should be, when you have a general purpose lexer at your disposal. regards, finn |