On 3/1/07, Greg Ewing <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: > > You start with a traceback object pointing to the current frame > > object (traceback objects are distinct from frame objects, > > Just out of curiosity, is it really necessary to have > a distinct traceback object? Couldn't the traceback > just be made of dead frame objects linked the opposite > way through their f_next pointers?
That would be rather fragile; there's tons of code that follows f_next pointers, without regard for whether the frame is alive or dead. Using a separate pointer would be a possibility, but it would probably still mean setting the f_next pointers to NULL to avoid hard cycles. Maybe this idea could be used for a new VM design though. > Seems to me it would be advantageous if raising an > exception (once it's created) could be done without > having to allocate any memory. Otherwise you could > get the situation where you're trying to raise a > MemoryError, but there's no memory to allocate a > traceback object, so you raise a MemoryError... > etc... > > That might be a reason for pre-allocating the > MemoryError exception, too. I think it is preallocated. -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com