Re: [Python-Dev] with_traceback

2007-03-01 Thread Greg Ewing
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 traceba

Re: [Python-Dev] with_traceback

2007-03-01 Thread Greg Ewing
Michael Foord wrote: > With the > proposed changes, modules that do this would *continue* to work, surely > ? Probably, but it might mean they were no longer thread safe. An exception caught and raised in one thread would be vulnerable to having its traceback clobbered by another thread raising

Re: [Python-Dev] with_traceback

2007-03-01 Thread Greg Ewing
[EMAIL PROTECTED] wrote: > Perhaps the use-cases for attaching the traceback object > to the exception would be better satisfied by simply having > sys.exc_info() return an object with methods like Failure? > I can't think of a good name for the new object type, Maybe we could call it a 'catch'

Re: [Python-Dev] PEP 306 changes (How to Change Python's Grammar)

2007-03-01 Thread Nick Coghlan
Jack Diederich wrote: > __ Python/compile.c: You will need to create or modify the >compiler_* functions for your productions. Python/symtable.c will likely also need attention at this point (it handles the symbol collection pass that occurs before the actual compilation pass) Cheer

Re: [Python-Dev] PEP 306 changes (How to Change Python's Grammar)

2007-03-01 Thread Guido van Rossum
Someone please check this in! On 3/1/07, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Jack Diederich wrote: > > __ Python/compile.c: You will need to create or modify the > >compiler_* functions for your productions. > > Python/symtable.c will likely also need attention at this point (it

Re: [Python-Dev] with_traceback

2007-03-01 Thread James Y Knight
On Mar 1, 2007, at 3:27 AM, Greg Ewing wrote: > James Y Knight wrote: >> 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

Re: [Python-Dev] Class destructor

2007-03-01 Thread Guido van Rossum
On 2/28/07, Nick Maclaren <[EMAIL PROTECTED]> wrote: > I am gradually making progress with my binary floating-point software, > but have had to rewrite several times as I have forgotten most of the > details of how to do it! After 30 years, I can't say I am surprised. > > But I need to clean up wo

Re: [Python-Dev] with_traceback

2007-03-01 Thread Guido van Rossum
On 2/28/07, James Y Knight <[EMAIL PROTECTED]> wrote: > On Feb 28, 2007, at 9:10 PM, Guido van Rossum wrote: > > I am beginning to think that there are serious problems with attaching > > the traceback to the exception; I really don't like the answer that > > pre-creating an exception is unpythonic

Re: [Python-Dev] with_traceback

2007-03-01 Thread Guido van Rossum
On 2/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > On Wed, 28 Feb 2007 18:10:21 -0800, Guido van Rossum <[EMAIL PROTECTED]> > wrote: > >I am beginning to think that there are serious problems with attaching > >the traceback to the exception; I really don't like the answer that > >pre-cre

Re: [Python-Dev] with_traceback

2007-03-01 Thread Guido van Rossum
[Summary: James Knight's idea can't work unless we copy the entire stack, which is bad. Disregard my previous posts in this thread of a few minutes ago. See the end of this post why.] On 3/1/07, Greg Ewing <[EMAIL PROTECTED]> wrote: > James Y Knight wrote: > > > It seems to me that a stack trace s

Re: [Python-Dev] with_traceback

2007-03-01 Thread Greg Ewing
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

Re: [Python-Dev] with_traceback

2007-03-01 Thread Guido van Rossum
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? Coul