int() shortcoming?

Matthew Knepley knepley at mcs.anl.gov
Fri Nov 22 09:23:08 EST 2002


       Is there a reason I should have to specify the base for a string
conversion using int() when it is already clear from the form? For instance:

>>> oct(15)
'017'
>>> int('017')
17
>>> int('017', 8)
15

and hexidecimal actually generates an error.

    Thanks,

        Matt
-- 
"Failure has a thousand explanations. Success doesn't need one" -- Sir Alec Guiness



More information about the Python-list mailing list