[Python-ideas] int('0x3241fca1')

MRAB python at mrabarnett.plus.com
Thu Feb 6 14:22:21 CET 2014


On 2014-02-06 10:24, Ram Rachum wrote:
> What do you think about letting the `int` constructor automatically
> understand the number type without specifying base if given a prefix, so
> int('0x3414fa') would immediately work without specifying a base of 16?
>
The base defaults to 10, but:

 >>> int('0x3241fca1', 0)
843185313



More information about the Python-ideas mailing list