James Y Knight wrote: > It seems to me that a stack trace should always be attached to an > exception object at creation time
Um. Yes. Well, that's certainly an innovative solution... > The traceback won't necessarily be *useful*, Almost completely use*less*, I would have thought. The traceback is mostly used to find out where something went wrong, not where it went right (i.e. successful creation of the exception). > creating the traceback is generally very expensive, I don't think so -- isn't it just a linked list of existing stack frames? That should be very cheap to create. > From http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Throwable.html: > >>A throwable contains a snapshot of the execution stack of its >>thread at the time it was created. This would be a major and surprising change to Python users. It would also be considerably *more* expensive to implement than the current scheme, because it would require copying the entire stack, instead of just linking stack frames together as they are unwound during the search for an exception handler. -- Greg _______________________________________________ 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