On 1/8/2010 12:50 PM, casevh wrote:

These are numeric objects created by gmpy. I'm trying to minimize the
overhead for using mpz with small numbers. Objects are created and
deleted very often by the interpreter as expressions are evaluated. I
don't keep ownership of the objects.

CPython creates a hidden list of small ints on startup for the same reason. Currently about -10 to 256. int.__new__ checks that a requested int object would have a value in this range (if so, reuse) -- or not (create new object).

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to