A better way to timeout a class method?
nick at craig-wood.com
Mon Mar 9 23:30:04 CET 2009
Marco Mariani <marco at sferacarta.com> wrote:
> John O'Hagan wrote:
> > Is there a concise Pythonic way to write a method with a timeout?
> No need for threading. Just define a signal handler and call signal.alarm().
> See the example at the end of the page:
Won't work on windows and there is only one sigalarm timer, so you
can't nest them :-(
Nick Craig-Wood <nick at craig-wood.com> -- http://www.craig-wood.com/nick
More information about the Python-list