Popular Python recipes tagged "generic"http://code.activestate.com/recipes/langs/python/tags/generic/2010-02-04T17:36:31-08:00ActiveState Code RecipesTimeout Any Function (Python)
2010-02-04T17:36:31-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577028-timeout-any-function/
<p style="color: grey">
Python
recipe 577028
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/asynchronous/">asynchronous</a>, <a href="/recipes/tags/generic/">generic</a>, <a href="/recipes/tags/process/">process</a>, <a href="/recipes/tags/timeout/">timeout</a>, <a href="/recipes/tags/universal_code/">universal_code</a>).
Revision 6.
</p>
<p>This recipe uses the <code>multiprocessing</code> module to kill functions that have run longer than intended. Unlike other recipes that use threading, this code is designed to actually kill execution that has continued for too long. This implementation does not rely on signals or anything that is OS specific, so it should work on any system on which you might need generic timeouts.</p>
Dummy object (Python)
2008-09-06T03:43:13-07:00nosklohttp://code.activestate.com/recipes/users/4166478/http://code.activestate.com/recipes/576447-dummy-object/
<p style="color: grey">
Python
recipe 576447
by <a href="/recipes/users/4166478/">nosklo</a>
(<a href="/recipes/tags/debug/">debug</a>, <a href="/recipes/tags/dummy/">dummy</a>, <a href="/recipes/tags/generic/">generic</a>, <a href="/recipes/tags/stupid/">stupid</a>, <a href="/recipes/tags/useless/">useless</a>).
Revision 7.
</p>
<p>Have you wished for a completely Dummy object, one that you can do whatever you want to it? One you can return and all expressions will work? </p>
<p>No???</p>
<p>Hmm.. ok. But here it is anyway.</p>