"Duncan Booth" <du**********@invalid.invalidwrote in message
news:Xn*************************@127.0.0.1...
|
Ma************@gmail.com wrote under the subject line "Is this a
| bug in int()?":
| >>>>int('0x', 16)
| 0
| >
| I think it is a general problem in the tokenizer, not just the 'int'
| constructor. The syntax for integers says:
|
| hexinteger ::= "0" ("x" | "X") hexdigit+
|
| but 0x appears to be accepted in source code as an integer.
|
| If I were you, I'd try reporting it as a bug.
The mismatch between doc and behavior certainly is a bug.
One should change.