Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

Le dimanche 29 juin 2008 à 21:52 +0000, Martin v. Löwis a écrit :
> Can you propose an implementation strategy that doesn't create the
> object, yet still avoids duplication of large chunks of code?

If by "duplicating large chunks of code", you mean creating a separate
code path for when the calculated number of digits necessary to hold the
int is equal to 1, then I don't have an implementation strategy.

I was going to say that creating and then immedietaly releasing a long
should not be very costly since longs have a freelist, but then I
checked and there is no freelist :-) (although there is a patch to add
one in #2013)

Anyway, the benefit IMO isn't in speeding up the conversion but in
avoiding to store new objects in memory when we can re-use the existing
singletons.

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3236>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to