Will python ever have signalhandlers in threads?

Tim Peters tim.peters at gmail.com
Sun Nov 21 01:02:17 EST 2004


[Antoon Pardon]
> I'm talking about PyThreadState_SetAsyncExc only as a throw in
> response to your previous remark. The main subject is signals.

OK.
...

> Well wether the work is done or not hardly seems to matter. The
> documentation as worded now seems to make it clear, this isn't
> going get into the language.

But you're still talking about PyThreadState_SetAsyncExc here, right?

Explained last time that it can't possibly "get into the language" in
the state it's in now.  The people who orginally did the work got
everything they wanted at the time:  the C API function, and the
then-new thread.interrupt_main() function in Python.  They didn't ask
for more than that, and they didn't work on more than that.

Doing more work is a necessary prerequisite if people want more than
that in the language.  Making the case that it should be in the
language is part of that work, but, if you haven't noticed, PEPs that
have working implementations fare much better than PEPs that don't. 
Indeed, no PEP without an implementation has ever been released
<wink>.

...

> As I understand the doc, one doesn't plan to begin working on a
> Python-level feature and even if someone else implements it, it
> has no chance of getting in the language.

Sorry, couldn't make sense of that sentence.

> As I read the docs it is not so much a question of the feature not
> being ready for the langauge, but a question of Guido not wanting the
> feature to be in the language.

You're still talking about PyThreadState_SetAsyncExc?  I haven't asked
Guido about it, and I can't find any design discussion of that
function anywhere.  I think it got added during a European sprint.  If
you want to know what he thinks, ask him.  If you want a definitive
ruling, write a PEP.

> This just to show that having someone implement it, is not
> the biggest hurdle as your prevous remark seemed to suggest
> to me.

An implementation is prerequisite to release, but isn't necessarily
sufficient.  I explained in detail last time why the current C code
has no claim to being "an implementation" of a *Python*-level spelling
of this functionality, so neither a suitable implementation nor the
necessary design discusiion have been done in this case.

If this is something you want, but you also want guaranteed acceptance
in advance of doing more than writing about it, that won't work.  If
you ask Guido, and he can make time to answer, you may get guaranteed
rejection in advance -- or you may not.  A PEP would be a good thing
to have in *either* case.

 ...

> Although you can't help me with my main question, I like to express
> my appreciation for your responses. They have been very insighfull
> and I'll be sure to use them to my advantage.

My fondest hope is that you'll be able to use them to crush Guido into
submission <wink>.



More information about the Python-list mailing list