Latest recipes tagged "prototyping" Code RecipesAttributes as local variables inside a with clause (Python) 2010-08-25T16:42:13-07:00Joakim Pettersson <p style="color: grey"> Python recipe 577372 by <a href="/recipes/users/4174760/">Joakim Pettersson</a> (<a href="/recipes/tags/command/">command</a>, <a href="/recipes/tags/prototyping/">prototyping</a>, <a href="/recipes/tags/syntax/">syntax</a>). Revision 2. </p> <p>This recipe defines three context managers that make it easier to step in and out of different parameter sets (‘Attributes’), allows data inheritance on such data sets (‘Scope’) and lets remote interpreters behave likewise (‘Workspace’). Just use “with object:” and there you have all its attributes ready to use as local variables. Changes are committed back into the object on exit from the ‘with’ clause. </p> Basic class code generator (Python) 2010-03-22T10:58:19-07:00Mateyuzo <p style="color: grey"> Python recipe 577130 by <a href="/recipes/users/4172453/">Mateyuzo</a> (<a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/prototyping/">prototyping</a>, <a href="/recipes/tags/template/">template</a>). Revision 5. </p> <p>This little script takes a yaml file as a class definition and generates code stubs and unit tests.</p>