string.atoi and string.atol broken?

Christos TZOTZIOY Georgiou tzot at
Wed Jan 26 06:03:18 EST 2005

On Wed, 26 Jan 2005 02:10:44 +0100, rumours say that "Fredrik Lundh"
<fredrik at> might have written:

>Mike Moum wrote:

>> s.atoi('4',3) should result in 11
>> s.atoi('13',4) should result in 31
>> s.atoi('12',4) should result in 30
>> s.atoi('8',4) is legitimate, but it generates an error.
>> Is this a bug, or am I missing something obvious?

>the function's named "atoi", not "atoitoa".


s.itoa(4,3) should result in '11'
s.itoa(13,4) should result in '31'
s.itoa(12,4) should result in '30'
s.itoa(8,4) should result in '20'

s.atoi('4', 3) should fail
s.atoi('13', 4) should result in 7
s.atoi('12', 4) should result in 6
s.atoi('8', 4) should fail

</automatic_effbot_post_translator_powered_by_python> :)
TZOTZIOY, I speak England very best.
"Be strict when sending and tolerant when receiving." (from RFC1958)
I really should keep that in mind when talking with people, actually...

More information about the Python-list mailing list