blob: d7a23e4cb488ef2172a96e12b43097d2203d8725 (
plain)
1
2
3
4
5
6
|
<span id="cporting-howto"></span><h1>Porting Extension Modules to Python 3</h1> <p>We recommend the following resources for porting extension modules to Python 3:</p> <ul class="simple"> <li>The <a class="reference external" href="http://python3porting.com/cextensions.html">Migrating C extensions</a> chapter from <em>Supporting Python 3: An in-depth guide</em>, a book on moving from Python 2 to Python 3 in general, guides the reader through porting an extension module.</li> <li>The <a class="reference external" href="https://py3c.readthedocs.io/en/latest/guide.html">Porting guide</a> from the <em>py3c</em> project provides opinionated suggestions with supporting code.</li> <li>The <a class="reference external" href="https://cython.org/">Cython</a> and <a class="reference external" href="https://cffi.readthedocs.io/en/latest/">CFFI</a> libraries offer abstractions over Python’s C API. Extensions generally need to be re-written to use one of them, but the library then handles differences between various Python versions and implementations.</li> </ul> <div class="_attribution">
<p class="_attribution-p">
© 2001–2023 Python Software Foundation<br>Licensed under the PSF License.<br>
<a href="https://docs.python.org/3.12/howto/cporting.html" class="_attribution-link">https://docs.python.org/3.12/howto/cporting.html</a>
</p>
</div>
|