int() 24 times slower then long() in Python 2.3

Paul Rubin http
Tue Jul 13 17:34:25 EDT 2004


"Nick Smallbone" <nick at nick8325.freeserve.co.uk> writes:
> >
> > IMO the speed at which a bunch of invalid conversions are
> > executed means nothing at all. Could you come up with an example
> > that show the same symptoms in a meaningful context?
> 
> What do you mean? bbbbaaaa is a hex number.
> 
> >>> int('bbbbaaaa', 16)
> 3149638314L

It's not an int.  It has to attempt to convert to int, trap the error
and recover from it, and then convert to a long.



More information about the Python-list mailing list