Title: int() doesn't 'guess'
Type: Stage:
Components: Documentation Versions: Python 2.6
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: benjamin.peterson, georg.brandl, kjohnson
Priority: normal Keywords:

Created on 2008-09-14 11:58 by kjohnson, last changed 2008-09-14 16:02 by benjamin.peterson. This issue is now closed.

Messages (2)
msg73214 - (view) Author: Kent Johnson (kjohnson) * Date: 2008-09-14 11:58
The library reference for int() says, "If radix is zero, the proper
radix is guessed based on the contents of string; the interpretation is
the same as for integer literals." The use of the word 'guess' implies
that there is some heuristic used here, that somehow the function will
look at an arbitrary number and figure out the correct radix. This can
confuse newbies:

'determined' might be a better word. For bonus points link to the
Language Reference page on integer literals:
msg73227 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-09-14 16:02
Thanks for the suggestion! Fixed in r66459.
Date User Action Args
2008-09-14 16:02:49benjamin.petersonsetstatus: open -> closed
nosy: + benjamin.peterson
resolution: fixed
messages: + msg73227
2008-09-14 11:58:05kjohnsoncreate