[Python-Dev] with_traceback

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Mar 1 03:52:33 CET 2007

Adam Olsen wrote:

> How plausible would it be to optimize all exception instantiation?
> Perhaps use slots and a freelist for everything inheriting from
> BaseException and not inheriting from other builtin types?

I'm not sure a free list would help much for instances
of user define classes, since creating one involves setting
up a dict, etc. And if you use __slots__ you end up with
objects of different sizes, which isn't free-list-friendly.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | Carpe post meridiem!          	  |
Christchurch, New Zealand	   | (I'm not a morning person.)          |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+

More information about the Python-Dev mailing list