[Python-3000] threading, part 2

Josiah Carlson jcarlson at uci.edu
Mon Aug 14 21:15:18 CEST 2006


"Guido van Rossum" <guido at python.org> wrote:
> 
> On 8/11/06, tomer filiba <tomerfiliba at gmail.com> wrote:
> > i mailed this to several people separately, but then i thought it could
> > benefit the entire group:
> >
> > http://sebulba.wikispaces.com/recipe+thread2
> >
> > it's an implementation of the proposed " thread.raise_exc", through an extension
> > to the threading.Thread class. you can test it for yourself; if it proves useful,
> > it should be exposed as thread.raise_exc in the stdlib (instead of the ctypes
> > hack)... and of course it should be reflected in threading.Thread as welll.
> 
> Cool. Question: what's the problem with raising exception instances?
> Especially in the light of my proposal to use
> 
>   raise SomeException(42)
> 
> in preference over (and perhaps exclusively instead of)

The problem is that it is not implemented in the underlying CPython API
PyThreadState_SetAsyncExc function.

 - Josiah



More information about the Python-3000 mailing list