D
Diez B. Roggisch
Nick said:I'm assuming that the timeout function is running in a thread...
I wouldn't assume that - it could be a python on a platform without threads.
I really don't think that your idea is worth the effort. If there is
something that can be safely interrupted at any given point in time -
which is the exception, not the rule - then one can "code around" that
missing feature, by spawning a subprocess python, using pyro to
communicate, and terminate it. I've done so before.
Some people here said "we're adults, we make sure our code will be
safely interruptable". But first of all, even adults make errors, and
even more important: most of the time such a feature is wanted, it's
about limiting some scripts that come from an untrusted source - like
user-written plugins. Such a feature would encourage people to use it in
such cases, but not stand up for the nastiness it may provoke.
Diez