[Python-Dev] Re: tp_clear return value

Tim Peters tim.one@comcast.net
Thu, 10 Apr 2003 22:51:27 -0400


[Greg Ewing]
> I'd be pretty nervous about having any longjmps anywhere
> near anything Python.

Why?

> If you do this, you'll have to make it very clear that
> tp_traverse implementations MUST NOT alter any Python
> ref counts, or rely in any other way on running to
> completion.

That's so.  For reasons explained earlier, it would be quite surprising to
see a tp_traverse function play with anything's refcount (their purpose is
to pass an object's PyObject* pointers on to the callback argument, and
that's all; manipulating refcounts during this wouldn't make sense).