[Python-Dev] with_traceback

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Mar 1 00:45:17 CET 2007


glyph at divmod.com wrote:

> Or modify __new__ on your particular heavily-optimized
> exception to have a free-list,

Doing that in Python is likely to have as much overhead as
creating an instance.

The simple and obvious optimisation is to pre-create the
instance, but we're proposing to make the obvious way
wrong for subtle reasons. That doesn't seem pythonic
to me.

--
Greg


More information about the Python-Dev mailing list