A better way to timeout a class method?

Marco Mariani marco at sferacarta.com
Mon Mar 9 11:55:32 EDT 2009


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:

http://docs.python.org/library/signal.html



More information about the Python-list mailing list