On 9/2/06, Calvin Spealman <[EMAIL PROTECTED]> wrote:
Basically. Memory usage goes up if you do this as it stands now.
On 9/2/06, Brett Cannon <[EMAIL PROTECTED]> wrote:
> Right, which is why the original suggestion came up in the first place. It
> would be nice to compartmentalize exceptions entirely, but the worry of
> keeping a ont of memory alive for it needs to be addressed, especially if
> exceptions are to be kept lightweight and usable for things other than
> flagging errors.
>
> -Brett
So, at issue is attaching tracebacks to exceptions keeps too much
alive and thus makes exceptions too heavy?
Basically. Memory usage goes up if you do this as it stands now.
If the traceback was passed
to the exception constructor and then held as an attribute of the
exception, any exception meant for "light" work (ie., not normal error
flagging) could simply decided not to include the traceback, and so it
would be destroyed, removing the weight from the exception. Similarly,
tracebacks could have some lean() method to drop references to the
frames.
Problem with that is you then lose any API guarantees of the traceback being there, which would mean you would still need to keep around sys.exc_info().
-Brett
_______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
