Popular Python recipes tagged "meta:requires=builtins"http://code.activestate.com/recipes/langs/python/tags/meta:requires=builtins/2009-09-15T00:34:37-07:00ActiveState Code RecipesDecorator for BindingConstants at compile time (Python)
2009-09-15T00:34:37-07:00Gabriel Genellinahttp://code.activestate.com/recipes/users/924636/http://code.activestate.com/recipes/576904-decorator-for-bindingconstants-at-compile-time/
<p style="color: grey">
Python
recipe 576904
by <a href="/recipes/users/924636/">Gabriel Genellina</a>
(<a href="/recipes/tags/optimisation/">optimisation</a>, <a href="/recipes/tags/optimization/">optimization</a>, <a href="/recipes/tags/programs/">programs</a>).
</p>
<p>Decorator for automatic code optimization. If a global is known at compile time, replace it with a constant. Fold tuples of constants into a single constant. Fold constant attribute lookups into a single constant.</p>
<p>This is only an update of <a href="http://code.activestate.com/recipes/277940/">Recipe 277940</a>, making it compatible with Python 3. All credit must go to the original author, Raymond Hettinger.</p>
Autogenerate API docs in Markdown (Python)
2009-04-28T23:11:26-07:00geremy condrahttp://code.activestate.com/recipes/users/4170000/http://code.activestate.com/recipes/576733-autogenerate-api-docs-in-markdown/
<p style="color: grey">
Python
recipe 576733
by <a href="/recipes/users/4170000/">geremy condra</a>
(<a href="/recipes/tags/documentation/">documentation</a>, <a href="/recipes/tags/markdown/">markdown</a>).
Revision 2.
</p>
<p>markdowndoc is a pydoc extension that allows you to autogenerate API docs for websites that use Markdown. We specifically developed it with Gitorious's wikis in mind, but it should work for other wikispaces and, of course, ActiveState. You can see a few examples of it <a href="http://gitorious.org/projects/python-markdown-api-builder/pages/Home">here</a>. </p>
Round to base (Python)
2009-01-28T09:48:13-08:00David Lamberthttp://code.activestate.com/recipes/users/4167420/http://code.activestate.com/recipes/576637-round-to-base/
<p style="color: grey">
Python
recipe 576637
by <a href="/recipes/users/4167420/">David Lambert</a>
.
</p>
<p>This python3 code generalizes rounding. It includes a "base" argument, which can be a float greater than 0. The "number of places" argument may also be a float. When the base is 10 Round uses builtins.round.</p>