[Python-3000] Fwd: Re: Fwd: Re: Octal

Terry Reedy tjreedy at udel.edu
Thu Mar 15 21:47:15 CET 2007


"Nicko van Someren" <nicko at nicko.org> wrote in message 
news:F85A7BFC-E4E7-4287-912D-FA38BE617648 at nicko.org...
| On 14 Mar 2007, at 23:08, Guido van Rossum wrote:
| > IOW, the only thing I'm unsure about is whether int('0012', 0) should
| > return 10 or complain like eval('0012') would. Perhaps it's best to
| > say that int('0012', 0) is a safer way to parse Python int literals,
| > and that would make it an error.
|
| The current documentation for the int() says "If radix is zero ...
| the interpretation is the same as for integer literals."  I very much
| think that this should remain true.

I agree.  Adding an exception just slightly clouds the language.  Anyway, 
int('12',8) in one *less* character to type!

Terry Jan Reedy





More information about the Python-3000 mailing list