Top-rated recipes tagged "deferred"http://code.activestate.com/recipes/tags/deferred/top/2011-08-12T23:08:30-07:00ActiveState Code RecipesSmarter Default Arguments (Python) 2011-08-12T23:06:57-07:00Eric Snowhttp://code.activestate.com/recipes/users/4177816/http://code.activestate.com/recipes/577786-smarter-default-arguments/ <p style="color: grey"> Python recipe 577786 by <a href="/recipes/users/4177816/">Eric Snow</a> (<a href="/recipes/tags/default_arguments/">default_arguments</a>, <a href="/recipes/tags/deferred/">deferred</a>, <a href="/recipes/tags/function/">function</a>, <a href="/recipes/tags/functions/">functions</a>). Revision 3. </p> <p>Improved handling of mutable and deferred default arguments. After the recipe you'll find an explanation of what that means.</p> <p>Works for 2.7 with minor tweaks (getfullargspec --> getargspec).</p> An Introduction to Deferred Default Arguments (Python) 2011-08-12T23:08:30-07:00Eric Snowhttp://code.activestate.com/recipes/users/4177816/http://code.activestate.com/recipes/577789-an-introduction-to-deferred-default-arguments/ <p style="color: grey"> Python recipe 577789 by <a href="/recipes/users/4177816/">Eric Snow</a> (<a href="/recipes/tags/default_arguments/">default_arguments</a>, <a href="/recipes/tags/deferred/">deferred</a>). Revision 2. </p> <p>If you have a function that calls another, passing through an argument, you likely want the default argument of your function to match that of the called function.</p> <p>Deferred default arguments is what I call the technique of using a sentinel for the default argument of your function and having the called function translate the sentinel into its own default argument.</p> <p>You'll find a more thorough treatment after the recipe.</p> Twisted Public Deferred (Python) 2009-12-08T09:47:16-08:00Alan Franzonihttp://code.activestate.com/recipes/users/4169882/http://code.activestate.com/recipes/576978-twisted-public-deferred/ <p style="color: grey"> Python recipe 576978 by <a href="/recipes/users/4169882/">Alan Franzoni</a> (<a href="/recipes/tags/deferred/">deferred</a>, <a href="/recipes/tags/twisted/">twisted</a>). Revision 5. </p> <p>This small piece of code helps separating the "public" and "private" interface parts of deferred objects in Twisted.</p> <p>Although it might not be really useful in production code, it is great for newcomers who are still learning the framework.</p>