sending thread exceptions (was Re: RELEASED Python 2.3.1)

Peter Hansen peter at engcorp.com
Wed Sep 24 11:29:27 EDT 2003


Anthony Baxter wrote:
> 
> On behalf of the Python development team and the Python community, I'm
> happy to announce the release of Python 2.3.1 (final).

The highlights mention the existence of a new API PyThreadState_SetAsyncEnc,
which is "deliberately accessible only from C", that can interrupt a thread 
by sending it an exception.

I can't find an online discussion of this, so I'm asking here.  Why was this
made accessible only from C?  Is it dangerous?  Experimental?  Someone feels
it will be used inappropriately if too readily available at the Python level?

Presumably somebody will come up with a little extension module or other 
technique for calling this which will let anyone use it at will, so I'm unclear 
on why it should be made inaccessible from Python.

-Peter




More information about the Python-list mailing list