Popular recipes by Maxim Khesin http://code.activestate.com/recipes/users/2591465/2009-03-27T07:39:13-07:00ActiveState Code Recipesprint variables as a dictionarly (Python)
2009-03-27T07:39:13-07:00Maxim Khesinhttp://code.activestate.com/recipes/users/2591465/http://code.activestate.com/recipes/576700-print-variables-as-a-dictionarly/
<p style="color: grey">
Python
recipe 576700
by <a href="/recipes/users/2591465/">Maxim Khesin</a>
(<a href="/recipes/tags/debugging/">debugging</a>, <a href="/recipes/tags/inspection/">inspection</a>, <a href="/recipes/tags/print/">print</a>).
Revision 2.
</p>
<p>Often I need to print some diagnostic variables and have to construct a format string to include both name and value; but there is a quicker way! This is especially useful for tracing function call values (foo in example below)</p>
Boost.Bind in Python (a variation of Curry technique, partial function application) (Python)
2005-09-22T04:47:28-07:00Maxim Khesinhttp://code.activestate.com/recipes/users/2591465/http://code.activestate.com/recipes/440557-boostbind-in-python-a-variation-of-curry-technique/
<p style="color: grey">
Python
recipe 440557
by <a href="/recipes/users/2591465/">Maxim Khesin</a>
.
Revision 5.
</p>
<p>The Boost.Bind library
<a href="http://www.boost.org/libs/bind/bind.html" rel="nofollow">http://www.boost.org/libs/bind/bind.html</a>
, which I use a lot in C++, has a very nice implementation of the Curry technique. The main innovation of the library is usage of 'placeholders', which allows 'currying' arbitrary parameters in the arg list (please see discussion section). I missed this library in Python, and reimplementing it in a dynamic language was a piece of cake (and I did not have to yell at my compiler to get it done ;). Enjoy!</p>