Re: [Python-Dev] sys.settrace: behavior doesn't match docs

2011-05-02 Thread Ned Batchelder
Indeed, the 2.0 code is very different, and got this case right. I'm a little surprised no one is arguing that changing this code now could break some applications. Maybe the fact no one noticed the docs were wrong proves that no one ever tried returning None from a local trace function.

Re: [Python-Dev] sys.settrace: behavior doesn't match docs

2011-05-02 Thread Mark Hammond
On 2/05/2011 9:27 PM, Ned Batchelder wrote: ... Maybe the fact no one noticed the docs were wrong proves that no one ever tried returning None from a local trace function. Or if they did, they should have complained by now. IMO, if the behaviour regresses from how it is documented and how it

Re: [Python-Dev] sys.settrace: behavior doesn't match docs

2011-05-02 Thread Nick Coghlan
On Mon, May 2, 2011 at 10:47 PM, Mark Hammond mhamm...@skippinet.com.au wrote: On 2/05/2011 9:27 PM, Ned Batchelder wrote: ... Maybe the fact no one noticed the docs were wrong proves that no one ever tried returning None from a local trace function. Or if they did, they should have

[Python-Dev] sys.settrace: behavior doesn't match docs

2011-04-30 Thread Ned Batchelder
This week I learned something new about trace functions (how to write a C trace function that survives a sys.settrace(sys.gettrace()) round-trip), and while writing up what I learned, I was surprised to discover that trace functions don't behave the way I thought, or the way the docs say they

Re: [Python-Dev] sys.settrace: behavior doesn't match docs

2011-04-30 Thread Guido van Rossum
I think you need to go back farther in time. :-) In Python 2.0 the call_trace function in ceval.c has a completely different signature (but the docs are the same). I haven't checked all history but somewhere between 2.0 and 2.3, SET_LINENO-less tracing was added, and that's where the