[Patches] [ python-Patches-455966 ] Allow leading 0 in float/imag literals
noreply@sourceforge.net
noreply@sourceforge.net
Thu, 30 Aug 2001 13:53:38 -0700
Patches item #455966, was opened at 2001-08-27 17:31
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=455966&group_id=5470
Category: Parser/Compiler
Group: None
>Status: Closed
Resolution: Accepted
Priority: 5
Submitted By: Tim Peters (tim_one)
Assigned to: Tim Peters (tim_one)
Summary: Allow leading 0 in float/imag literals
Initial Comment:
Many years ago I was baffled that "0e0" as a literal
gave an error (it doesn't as a string argument to
float), and I never got used to it. While fixing a
bug earlier today, I noticed this comment in
tokenizer.c:
/* XXX This is broken! E.g.,
09.9 should be accepted as float! */
09.9 is accepted after the patch, but along with stuff
that isn't so clear, like 0777j same as 777j. OTOH,
even at that extreme, complex("0777j") returns 777j
without this patch too.
----------------------------------------------------------------------
>Comment By: Tim Peters (tim_one)
Date: 2001-08-30 13:53
Message:
Logged In: YES
user_id=31435
I brought the issue up on Jython-Dev but haven't heard back
yet.
Checked in, with more test cases than in the patch:
Doc/ref/ref2.tex; new revision: 1.31
Lib/tokenize.py; new revision: 1.28
Lib/test/test_compile.py; new revision: 1.8
Misc/NEWS; new revision: 1.219
Parser/tokenizer.c; new revision: 2.53
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2001-08-30 12:17
Message:
Logged In: YES
user_id=6380
Sounds like a good idea.
Is this also a Jython issue?
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=455966&group_id=5470