~dkuhlman/python-training-materials/Materials

« back to all changes in this revision

Viewing changes to python-3.5.1-docs-html/c-api/stable.html

  • Committer: Dave Kuhlman
  • Date: 2017-04-15 16:24:56 UTC
  • Revision ID: dkuhlman@davekuhlman.org-20170415162456-iav9vozzg4iwqwv3
Updated docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
 
 
4
 
 
5
 
<html xmlns="http://www.w3.org/1999/xhtml">
6
 
  <head>
7
 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
 
    
9
 
    <title>Stable Application Binary Interface &mdash; Python 3.5.1 documentation</title>
10
 
    
11
 
    <link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" />
12
 
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
13
 
    
14
 
    <script type="text/javascript">
15
 
      var DOCUMENTATION_OPTIONS = {
16
 
        URL_ROOT:    '../',
17
 
        VERSION:     '3.5.1',
18
 
        COLLAPSE_INDEX: false,
19
 
        FILE_SUFFIX: '.html',
20
 
        HAS_SOURCE:  true
21
 
      };
22
 
    </script>
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>
39
 
    
40
 
 
41
 
 
42
 
  </head>
43
 
  <body role="document">  
44
 
    <div class="related" role="navigation" aria-label="related navigation">
45
 
      <h3>Navigation</h3>
46
 
      <ul>
47
 
        <li class="right" style="margin-right: 10px">
48
 
          <a href="../genindex.html" title="General Index"
49
 
             accesskey="I">index</a></li>
50
 
        <li class="right" >
51
 
          <a href="../py-modindex.html" title="Python Module Index"
52
 
             >modules</a> |</li>
53
 
        <li class="right" >
54
 
          <a href="veryhigh.html" title="The Very High Level Layer"
55
 
             accesskey="N">next</a> |</li>
56
 
        <li class="right" >
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> &raquo;</li>
62
 
        <li>
63
 
          <span class="version_switcher_placeholder">3.5.1</span>
64
 
          <a href="../index.html">Documentation </a> &raquo;
65
 
        </li>
66
 
 
67
 
          <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Python/C API Reference Manual</a> &raquo;</li> 
68
 
      </ul>
69
 
    </div>    
70
 
 
71
 
    <div class="document">
72
 
      <div class="documentwrapper">
73
 
        <div class="bodywrapper">
74
 
          <div class="body" role="main">
75
 
            
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 &#8220;limited API&#8221;) 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&gt;=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 &#8220;Not part of the limited API.&#8221;</p>
104
 
</div>
105
 
 
106
 
 
107
 
          </div>
108
 
        </div>
109
 
      </div>
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>
115
 
  <h4>Next topic</h4>
116
 
  <p class="topless"><a href="veryhigh.html"
117
 
                        title="next chapter">The Very High Level Layer</a></p>
118
 
<h3>This Page</h3>
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>
123
 
</ul>
124
 
 
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" />
132
 
    </form>
133
 
    <p class="searchtip" style="font-size: 90%">
134
 
    Enter search terms or a module, class or function name.
135
 
    </p>
136
 
</div>
137
 
<script type="text/javascript">$('#searchbox').show(0);</script>
138
 
        </div>
139
 
      </div>
140
 
      <div class="clearer"></div>
141
 
    </div>  
142
 
    <div class="related" role="navigation" aria-label="related navigation">
143
 
      <h3>Navigation</h3>
144
 
      <ul>
145
 
        <li class="right" style="margin-right: 10px">
146
 
          <a href="../genindex.html" title="General Index"
147
 
             >index</a></li>
148
 
        <li class="right" >
149
 
          <a href="../py-modindex.html" title="Python Module Index"
150
 
             >modules</a> |</li>
151
 
        <li class="right" >
152
 
          <a href="veryhigh.html" title="The Very High Level Layer"
153
 
             >next</a> |</li>
154
 
        <li class="right" >
155
 
          <a href="intro.html" title="Introduction"
156
 
             >previous</a> |</li>
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> &raquo;</li>
160
 
        <li>
161
 
          <span class="version_switcher_placeholder">3.5.1</span>
162
 
          <a href="../index.html">Documentation </a> &raquo;
163
 
        </li>
164
 
 
165
 
          <li class="nav-item nav-item-1"><a href="index.html" >Python/C API Reference Manual</a> &raquo;</li> 
166
 
      </ul>
167
 
    </div>  
168
 
    <div class="footer">
169
 
    &copy; <a href="../copyright.html">Copyright</a> 1990-2016, Python Software Foundation.
170
 
    <br />
171
 
    The Python Software Foundation is a non-profit corporation.
172
 
    <a href="https://www.python.org/psf/donations/">Please donate.</a>
173
 
    <br />
174
 
    Last updated on Jan 28, 2016.
175
 
    <a href="../bugs.html">Found a bug</a>?
176
 
    <br />
177
 
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.3.3.
178
 
    </div>
179
 
 
180
 
  </body>
181
 
</html>
 
 
b'\\ No newline at end of file'