Message75439
You tested on 2.5.2 but marked this for 2.6. 3.0 gives
>>> int('\0')
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
int('\0')
UnicodeEncodeError: 'decimal' codec can't encode character '\x00' in
position 0: invalid decimal Unicode string
>>> int('\1')
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
int('\1')
ValueError: invalid literal for int() with base 10: '\x01'
>>> int('\1',256)
Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
int('\1',256)
ValueError: int() arg 2 must be >= 2 and <= 36
The 3.0 doc on string inputs
"A string must be a base-radix integer literal optionally preceded by
‘+’ or ‘-‘ (with no space in between) and optionally surrounded by
whitespace. A base-n literal consists of the digits 0 to n-1, with ‘a’
to ‘z’ (or ‘A’ to ‘Z’) having values 10 to 35."
in much clearer than the 2.6 doc
"If the argument is a string, it must contain a possibly signed decimal
number representable as a Python integer, possibly embedded in whitespace."
Even so, I do not see any inconsistency. |
|
Date |
User |
Action |
Args |
2008-11-01 07:10:43 | terry.reedy | set | recipients:
+ terry.reedy, georg.brandl, exarkun |
2008-11-01 07:10:42 | terry.reedy | set | messageid: <1225523442.81.0.225108844012.issue4221@psf.upfronthosting.co.za> |
2008-11-01 07:10:42 | terry.reedy | link | issue4221 messages |
2008-11-01 07:10:41 | terry.reedy | create | |
|