1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
<html xmlns="http://www.w3.org/1999/xhtml">
7
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9
<title>Stable Application Binary Interface — Python 3.5.1 documentation</title>
11
<link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" />
12
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
14
<script type="text/javascript">
15
var DOCUMENTATION_OPTIONS = {
18
COLLAPSE_INDEX: false,
23
<script type="text/javascript" src="../_static/jquery.js"></script>
24
<script type="text/javascript" src="../_static/underscore.js"></script>
25
<script type="text/javascript" src="../_static/doctools.js"></script>
26
<script type="text/javascript" src="../_static/sidebar.js"></script>
27
<link rel="search" type="application/opensearchdescription+xml"
28
title="Search within Python 3.5.1 documentation"
29
href="../_static/opensearch.xml"/>
30
<link rel="author" title="About these documents" href="../about.html" />
31
<link rel="copyright" title="Copyright" href="../copyright.html" />
32
<link rel="top" title="Python 3.5.1 documentation" href="../contents.html" />
33
<link rel="up" title="Python/C API Reference Manual" href="index.html" />
34
<link rel="next" title="The Very High Level Layer" href="veryhigh.html" />
35
<link rel="prev" title="Introduction" href="intro.html" />
36
<link rel="shortcut icon" type="image/png" href="../_static/py.png" />
37
<script type="text/javascript" src="../_static/copybutton.js"></script>
38
<script type="text/javascript" src="../_static/version_switch.js"></script>
43
<body role="document">
44
<div class="related" role="navigation" aria-label="related navigation">
47
<li class="right" style="margin-right: 10px">
48
<a href="../genindex.html" title="General Index"
49
accesskey="I">index</a></li>
51
<a href="../py-modindex.html" title="Python Module Index"
54
<a href="veryhigh.html" title="The Very High Level Layer"
55
accesskey="N">next</a> |</li>
57
<a href="intro.html" title="Introduction"
58
accesskey="P">previous</a> |</li>
59
<li><img src="../_static/py.png" alt=""
60
style="vertical-align: middle; margin-top: -1px"/></li>
61
<li><a href="https://www.python.org/">Python</a> »</li>
63
<span class="version_switcher_placeholder">3.5.1</span>
64
<a href="../index.html">Documentation </a> »
67
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Python/C API Reference Manual</a> »</li>
71
<div class="document">
72
<div class="documentwrapper">
73
<div class="bodywrapper">
74
<div class="body" role="main">
76
<div class="section" id="stable-application-binary-interface">
77
<span id="stable"></span><h1>Stable Application Binary Interface<a class="headerlink" href="#stable-application-binary-interface" title="Permalink to this headline">¶</a></h1>
78
<p>Traditionally, the C API of Python will change with every release. Most changes
79
will be source-compatible, typically by only adding API, rather than changing
80
existing API or removing API (although some interfaces do get removed after
81
being deprecated first).</p>
82
<p>Unfortunately, the API compatibility does not extend to binary compatibility
83
(the ABI). The reason is primarily the evolution of struct definitions, where
84
addition of a new field, or changing the type of a field, might not break the
85
API, but can break the ABI. As a consequence, extension modules need to be
86
recompiled for every Python release (although an exception is possible on Unix
87
when none of the affected interfaces are used). In addition, on Windows,
88
extension modules link with a specific pythonXY.dll and need to be recompiled to
89
link with a newer one.</p>
90
<p>Since Python 3.2, a subset of the API has been declared to guarantee a stable
91
ABI. Extension modules wishing to use this API (called “limited API”) need to
92
define <code class="docutils literal"><span class="pre">Py_LIMITED_API</span></code>. A number of interpreter details then become hidden
93
from the extension module; in return, a module is built that works on any 3.x
94
version (x>=2) without recompilation.</p>
95
<p>In some cases, the stable ABI needs to be extended with new functions.
96
Extension modules wishing to use these new APIs need to set <code class="docutils literal"><span class="pre">Py_LIMITED_API</span></code>
97
to the <code class="docutils literal"><span class="pre">PY_VERSION_HEX</span></code> value (see <a class="reference internal" href="apiabiversion.html#apiabiversion"><span>API and ABI Versioning</span></a>) of the minimum Python
98
version they want to support (e.g. <code class="docutils literal"><span class="pre">0x03030000</span></code> for Python 3.3). Such modules
99
will work on all subsequent Python releases, but fail to load (because of
100
missing symbols) on the older releases.</p>
101
<p>As of Python 3.2, the set of functions available to the limited API is
102
documented in <span class="target" id="index-0"></span><a class="pep reference external" href="https://www.python.org/dev/peps/pep-0384"><strong>PEP 384</strong></a>. In the C API documentation, API elements that are not
103
part of the limited API are marked as “Not part of the limited API.”</p>
110
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
111
<div class="sphinxsidebarwrapper">
112
<h4>Previous topic</h4>
113
<p class="topless"><a href="intro.html"
114
title="previous chapter">Introduction</a></p>
116
<p class="topless"><a href="veryhigh.html"
117
title="next chapter">The Very High Level Layer</a></p>
119
<ul class="this-page-menu">
120
<li><a href="../bugs.html">Report a Bug</a></li>
121
<li><a href="../_sources/c-api/stable.txt"
122
rel="nofollow">Show Source</a></li>
125
<div id="searchbox" style="display: none" role="search">
126
<h3>Quick search</h3>
127
<form class="search" action="../search.html" method="get">
128
<input type="text" name="q" />
129
<input type="submit" value="Go" />
130
<input type="hidden" name="check_keywords" value="yes" />
131
<input type="hidden" name="area" value="default" />
133
<p class="searchtip" style="font-size: 90%">
134
Enter search terms or a module, class or function name.
137
<script type="text/javascript">$('#searchbox').show(0);</script>
140
<div class="clearer"></div>
142
<div class="related" role="navigation" aria-label="related navigation">
145
<li class="right" style="margin-right: 10px">
146
<a href="../genindex.html" title="General Index"
149
<a href="../py-modindex.html" title="Python Module Index"
152
<a href="veryhigh.html" title="The Very High Level Layer"
155
<a href="intro.html" title="Introduction"
157
<li><img src="../_static/py.png" alt=""
158
style="vertical-align: middle; margin-top: -1px"/></li>
159
<li><a href="https://www.python.org/">Python</a> »</li>
161
<span class="version_switcher_placeholder">3.5.1</span>
162
<a href="../index.html">Documentation </a> »
165
<li class="nav-item nav-item-1"><a href="index.html" >Python/C API Reference Manual</a> »</li>
169
© <a href="../copyright.html">Copyright</a> 1990-2016, Python Software Foundation.
171
The Python Software Foundation is a non-profit corporation.
172
<a href="https://www.python.org/psf/donations/">Please donate.</a>
174
Last updated on Jan 28, 2016.
175
<a href="../bugs.html">Found a bug</a>?
177
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.3.3.
b'\\ No newline at end of file'