blob: b638e32f5d0ecba67fffb760f0effdb3b123358d [file] [log] [blame]
Benjamin Petersone9bbc8b2008-09-28 02:06:32 +00001.. highlightlang:: c
2
Guido van Rossum56076da2008-12-02 22:58:36 +00003.. _cporting-howto:
4
Larry Hastings62417a02012-02-28 16:21:47 -08005*************************************
6Porting Extension Modules to Python 3
7*************************************
Benjamin Petersone9bbc8b2008-09-28 02:06:32 +00008
Petr Viktorin2d3ff2b2018-09-24 12:42:33 +02009We recommend the following resources for porting extension modules to Python 3:
Benjamin Petersone9bbc8b2008-09-28 02:06:32 +000010
Petr Viktorin2d3ff2b2018-09-24 12:42:33 +020011* The `Migrating C extensions`_ chapter from
12 *Supporting Python 3: An in-depth guide*, a book on moving from Python 2
13 to Python 3 in general, guides the reader through porting an extension
14 module.
15* The `Porting guide`_ from the *py3c* project provides opinionated
16 suggestions with supporting code.
17* The `Cython`_ and `CFFI`_ libraries offer abstractions over
18 Python's C API.
19 Extensions generally need to be re-written to use one of them,
20 but the library then handles differences between various Python
21 versions and implementations.
Benjamin Petersone9bbc8b2008-09-28 02:06:32 +000022
Petr Viktorin2d3ff2b2018-09-24 12:42:33 +020023.. _Migrating C extensions: http://python3porting.com/cextensions.html
24.. _Porting guide: https://py3c.readthedocs.io/en/latest/guide.html
25.. _Cython: http://cython.org/
26.. _CFFI: https://cffi.readthedocs.io/en/latest/