Top-rated recipes tagged "backport"http://code.activestate.com/recipes/tags/backport/top/2015-09-08T01:27:04-07:00ActiveState Code RecipesPython 2 nonlocal (Python)
2015-09-08T01:27:04-07:00Ryan Gonzalezhttp://code.activestate.com/recipes/users/4187447/http://code.activestate.com/recipes/578965-python-2-nonlocal/
<p style="color: grey">
Python
recipe 578965
by <a href="/recipes/users/4187447/">Ryan Gonzalez</a>
(<a href="/recipes/tags/backport/">backport</a>, <a href="/recipes/tags/nonlocal/">nonlocal</a>, <a href="/recipes/tags/python2/">python2</a>).
Revision 2.
</p>
<p>This implements nonlocal in Python 2...albeit in a slightly ugly way. Tested with CPython 2.7 and PyPy.</p>
socket.sendfile() (Python)
2014-06-13T13:41:25-07:00Giampaolo RodolĂ http://code.activestate.com/recipes/users/4178764/http://code.activestate.com/recipes/578889-socketsendfile/
<p style="color: grey">
Python
recipe 578889
by <a href="/recipes/users/4178764/">Giampaolo RodolĂ </a>
(<a href="/recipes/tags/backport/">backport</a>, <a href="/recipes/tags/performance/">performance</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/sendfile/">sendfile</a>).
Revision 2.
</p>
<p>This is a backport of socket.sendfile() for Python 2.6 and 2.7.
socket.sendfile() will be included in Python 3.5:
<a href="http://bugs.python.org/issue17552" rel="nofollow">http://bugs.python.org/issue17552</a></p>
A Simple Class for Transforming Python Source Files (Python)
2011-07-12T22:04:44-07:00Eric Snowhttp://code.activestate.com/recipes/users/4177816/http://code.activestate.com/recipes/577788-a-simple-class-for-transforming-python-source-file/
<p style="color: grey">
Python
recipe 577788
by <a href="/recipes/users/4177816/">Eric Snow</a>
(<a href="/recipes/tags/backport/">backport</a>, <a href="/recipes/tags/transform/">transform</a>).
Revision 3.
</p>
<p>Subclass with some replacements and you are ready to go. If the replacements aren't good enough simply override the transform() method.</p>