literal numbers

Michael Hudson mwh at python.net
Mon Jul 26 07:01:30 EDT 2004


danb_83 at yahoo.com (Dan Bishop) writes:

> Willem Broekema <news at pastelhorn.com> wrote in message news:<qqWdnThBC-nI4ZzcRVn-pQ at speakeasy.net>...
[snip]
> > So "011.3" and "011.3j" are read as in base 10. Wouldn't a syntax error 
> > be more appropriate, as it is an attempt to read a floating point in 
> > octal, which is unsupported?

Seriously, is there any feasible excuse for wanting to format a
floating point number in a radix other than 10?

> I think the best solution would be to use some other syntax for octal
> literals.  Even without the float and complex weirdness, it's not at
> all obvious (except to C programmers) that 011 != 11.

Agreed.  Bit late now, though!

Cheers,
mwh

-- 
 "An infinite number of monkeys at an infinite number of keyboards
  could produce something like Usenet."
 "They could do a better job of it."
              -- the corollaries to Gene Spafford's Axiom #2 of Usenet



More information about the Python-list mailing list