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>Tuple Objects — Python 3.5.2 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.2 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.2 documentation" href="../contents.html" />
33
<link rel="up" title="Concrete Objects Layer" href="concrete.html" />
34
<link rel="next" title="List Objects" href="list.html" />
35
<link rel="prev" title="Unicode Objects and Codecs" href="unicode.html" />
36
<link rel="shortcut icon" type="image/png" href="../_static/py.png" />
38
<script type="text/javascript" src="../_static/copybutton.js"></script>
39
<script type="text/javascript" src="../_static/version_switch.js"></script>
45
<body role="document">
46
<div class="related" role="navigation" aria-label="related navigation">
49
<li class="right" style="margin-right: 10px">
50
<a href="../genindex.html" title="General Index"
51
accesskey="I">index</a></li>
53
<a href="../py-modindex.html" title="Python Module Index"
56
<a href="list.html" title="List Objects"
57
accesskey="N">next</a> |</li>
59
<a href="unicode.html" title="Unicode Objects and Codecs"
60
accesskey="P">previous</a> |</li>
61
<li><img src="../_static/py.png" alt=""
62
style="vertical-align: middle; margin-top: -1px"/></li>
63
<li><a href="https://www.python.org/">Python</a> »</li>
65
<span class="version_switcher_placeholder">3.5.2</span>
66
<a href="../index.html">Documentation </a> »
69
<li class="nav-item nav-item-1"><a href="index.html" >Python/C API Reference Manual</a> »</li>
70
<li class="nav-item nav-item-2"><a href="concrete.html" accesskey="U">Concrete Objects Layer</a> »</li>
74
<div class="inline-search" style="display: none" role="search">
75
<form class="inline-search" action="../search.html" method="get">
76
<input placeholder="Quick search" type="text" name="q" />
77
<input type="submit" value="Go" />
78
<input type="hidden" name="check_keywords" value="yes" />
79
<input type="hidden" name="area" value="default" />
82
<script type="text/javascript">$('.inline-search').show(0);</script>
89
<div class="document">
90
<div class="documentwrapper">
91
<div class="bodywrapper">
92
<div class="body" role="main">
94
<div class="section" id="tuple-objects">
95
<span id="tupleobjects"></span><h1>Tuple Objects<a class="headerlink" href="#tuple-objects" title="Permalink to this headline">¶</a></h1>
96
<span class="target" id="index-0"></span><dl class="type">
97
<dt id="c.PyTupleObject">
98
<code class="descname">PyTupleObject</code><a class="headerlink" href="#c.PyTupleObject" title="Permalink to this definition">¶</a></dt>
99
<dd><p>This subtype of <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><code class="xref c c-type docutils literal"><span class="pre">PyObject</span></code></a> represents a Python tuple object.</p>
103
<dt id="c.PyTuple_Type">
104
<a class="reference internal" href="type.html#c.PyTypeObject" title="PyTypeObject">PyTypeObject</a> <code class="descname">PyTuple_Type</code><a class="headerlink" href="#c.PyTuple_Type" title="Permalink to this definition">¶</a></dt>
105
<dd><p>This instance of <a class="reference internal" href="type.html#c.PyTypeObject" title="PyTypeObject"><code class="xref c c-type docutils literal"><span class="pre">PyTypeObject</span></code></a> represents the Python tuple type; it
106
is the same object as <a class="reference internal" href="../library/stdtypes.html#tuple" title="tuple"><code class="xref py py-class docutils literal"><span class="pre">tuple</span></code></a> in the Python layer.</p>
109
<dl class="function">
110
<dt id="c.PyTuple_Check">
111
int <code class="descname">PyTuple_Check</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *p</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyTuple_Check" title="Permalink to this definition">¶</a></dt>
112
<dd><p>Return true if <em>p</em> is a tuple object or an instance of a subtype of the tuple
116
<dl class="function">
117
<dt id="c.PyTuple_CheckExact">
118
int <code class="descname">PyTuple_CheckExact</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *p</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyTuple_CheckExact" title="Permalink to this definition">¶</a></dt>
119
<dd><p>Return true if <em>p</em> is a tuple object, but not an instance of a subtype of the
123
<dl class="function">
124
<dt id="c.PyTuple_New">
125
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyTuple_New</code><span class="sig-paren">(</span>Py_ssize_t<em> len</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyTuple_New" title="Permalink to this definition">¶</a></dt>
126
<dd><em class="refcount">Return value: New reference.</em><p>Return a new tuple object of size <em>len</em>, or <em>NULL</em> on failure.</p>
129
<dl class="function">
130
<dt id="c.PyTuple_Pack">
131
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyTuple_Pack</code><span class="sig-paren">(</span>Py_ssize_t<em> n</em>, ...<span class="sig-paren">)</span><a class="headerlink" href="#c.PyTuple_Pack" title="Permalink to this definition">¶</a></dt>
132
<dd><em class="refcount">Return value: New reference.</em><p>Return a new tuple object of size <em>n</em>, or <em>NULL</em> on failure. The tuple values
133
are initialized to the subsequent <em>n</em> C arguments pointing to Python objects.
134
<code class="docutils literal"><span class="pre">PyTuple_Pack(2,</span> <span class="pre">a,</span> <span class="pre">b)</span></code> is equivalent to <code class="docutils literal"><span class="pre">Py_BuildValue("(OO)",</span> <span class="pre">a,</span> <span class="pre">b)</span></code>.</p>
137
<dl class="function">
138
<dt id="c.PyTuple_Size">
139
Py_ssize_t <code class="descname">PyTuple_Size</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *p</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyTuple_Size" title="Permalink to this definition">¶</a></dt>
140
<dd><p>Take a pointer to a tuple object, and return the size of that tuple.</p>
143
<dl class="function">
144
<dt id="c.PyTuple_GET_SIZE">
145
Py_ssize_t <code class="descname">PyTuple_GET_SIZE</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *p</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyTuple_GET_SIZE" title="Permalink to this definition">¶</a></dt>
146
<dd><p>Return the size of the tuple <em>p</em>, which must be non-<em>NULL</em> and point to a tuple;
147
no error checking is performed.</p>
150
<dl class="function">
151
<dt id="c.PyTuple_GetItem">
152
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyTuple_GetItem</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *p</em>, Py_ssize_t<em> pos</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyTuple_GetItem" title="Permalink to this definition">¶</a></dt>
153
<dd><em class="refcount">Return value: Borrowed reference.</em><p>Return the object at position <em>pos</em> in the tuple pointed to by <em>p</em>. If <em>pos</em> is
154
out of bounds, return <em>NULL</em> and sets an <a class="reference internal" href="../library/exceptions.html#IndexError" title="IndexError"><code class="xref py py-exc docutils literal"><span class="pre">IndexError</span></code></a> exception.</p>
157
<dl class="function">
158
<dt id="c.PyTuple_GET_ITEM">
159
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyTuple_GET_ITEM</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *p</em>, Py_ssize_t<em> pos</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyTuple_GET_ITEM" title="Permalink to this definition">¶</a></dt>
160
<dd><em class="refcount">Return value: Borrowed reference.</em><p>Like <a class="reference internal" href="#c.PyTuple_GetItem" title="PyTuple_GetItem"><code class="xref c c-func docutils literal"><span class="pre">PyTuple_GetItem()</span></code></a>, but does no checking of its arguments.</p>
163
<dl class="function">
164
<dt id="c.PyTuple_GetSlice">
165
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyTuple_GetSlice</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *p</em>, Py_ssize_t<em> low</em>, Py_ssize_t<em> high</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyTuple_GetSlice" title="Permalink to this definition">¶</a></dt>
166
<dd><em class="refcount">Return value: New reference.</em><p>Take a slice of the tuple pointed to by <em>p</em> from <em>low</em> to <em>high</em> and return it
170
<dl class="function">
171
<dt id="c.PyTuple_SetItem">
172
int <code class="descname">PyTuple_SetItem</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *p</em>, Py_ssize_t<em> pos</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *o</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyTuple_SetItem" title="Permalink to this definition">¶</a></dt>
173
<dd><p>Insert a reference to object <em>o</em> at position <em>pos</em> of the tuple pointed to by
174
<em>p</em>. Return <code class="docutils literal"><span class="pre">0</span></code> on success.</p>
175
<div class="admonition note">
176
<p class="first admonition-title">Note</p>
177
<p class="last">This function “steals” a reference to <em>o</em>.</p>
181
<dl class="function">
182
<dt id="c.PyTuple_SET_ITEM">
183
void <code class="descname">PyTuple_SET_ITEM</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *p</em>, Py_ssize_t<em> pos</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *o</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyTuple_SET_ITEM" title="Permalink to this definition">¶</a></dt>
184
<dd><p>Like <a class="reference internal" href="#c.PyTuple_SetItem" title="PyTuple_SetItem"><code class="xref c c-func docutils literal"><span class="pre">PyTuple_SetItem()</span></code></a>, but does no error checking, and should <em>only</em> be
185
used to fill in brand new tuples.</p>
186
<div class="admonition note">
187
<p class="first admonition-title">Note</p>
188
<p class="last">This function “steals” a reference to <em>o</em>.</p>
192
<dl class="function">
193
<dt id="c._PyTuple_Resize">
194
int <code class="descname">_PyTuple_Resize</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> **p</em>, Py_ssize_t<em> newsize</em><span class="sig-paren">)</span><a class="headerlink" href="#c._PyTuple_Resize" title="Permalink to this definition">¶</a></dt>
195
<dd><p>Can be used to resize a tuple. <em>newsize</em> will be the new length of the tuple.
196
Because tuples are <em>supposed</em> to be immutable, this should only be used if there
197
is only one reference to the object. Do <em>not</em> use this if the tuple may already
198
be known to some other part of the code. The tuple will always grow or shrink
199
at the end. Think of this as destroying the old tuple and creating a new one,
200
only more efficiently. Returns <code class="docutils literal"><span class="pre">0</span></code> on success. Client code should never
201
assume that the resulting value of <code class="docutils literal"><span class="pre">*p</span></code> will be the same as before calling
202
this function. If the object referenced by <code class="docutils literal"><span class="pre">*p</span></code> is replaced, the original
203
<code class="docutils literal"><span class="pre">*p</span></code> is destroyed. On failure, returns <code class="docutils literal"><span class="pre">-1</span></code> and sets <code class="docutils literal"><span class="pre">*p</span></code> to <em>NULL</em>, and
204
raises <a class="reference internal" href="../library/exceptions.html#MemoryError" title="MemoryError"><code class="xref py py-exc docutils literal"><span class="pre">MemoryError</span></code></a> or <a class="reference internal" href="../library/exceptions.html#SystemError" title="SystemError"><code class="xref py py-exc docutils literal"><span class="pre">SystemError</span></code></a>.</p>
207
<dl class="function">
208
<dt id="c.PyTuple_ClearFreeList">
209
int <code class="descname">PyTuple_ClearFreeList</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#c.PyTuple_ClearFreeList" title="Permalink to this definition">¶</a></dt>
210
<dd><p>Clear the free list. Return the total number of freed items.</p>
214
<div class="section" id="struct-sequence-objects">
215
<h1>Struct Sequence Objects<a class="headerlink" href="#struct-sequence-objects" title="Permalink to this headline">¶</a></h1>
216
<p>Struct sequence objects are the C equivalent of <a class="reference internal" href="../library/collections.html#collections.namedtuple" title="collections.namedtuple"><code class="xref py py-func docutils literal"><span class="pre">namedtuple()</span></code></a>
217
objects, i.e. a sequence whose items can also be accessed through attributes.
218
To create a struct sequence, you first have to create a specific struct sequence
220
<dl class="function">
221
<dt id="c.PyStructSequence_NewType">
222
<a class="reference internal" href="type.html#c.PyTypeObject" title="PyTypeObject">PyTypeObject</a>* <code class="descname">PyStructSequence_NewType</code><span class="sig-paren">(</span><a class="reference internal" href="#c.PyStructSequence_Desc" title="PyStructSequence_Desc">PyStructSequence_Desc</a><em> *desc</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyStructSequence_NewType" title="Permalink to this definition">¶</a></dt>
223
<dd><p>Create a new struct sequence type from the data in <em>desc</em>, described below. Instances
224
of the resulting type can be created with <a class="reference internal" href="#c.PyStructSequence_New" title="PyStructSequence_New"><code class="xref c c-func docutils literal"><span class="pre">PyStructSequence_New()</span></code></a>.</p>
227
<dl class="function">
228
<dt id="c.PyStructSequence_InitType">
229
void <code class="descname">PyStructSequence_InitType</code><span class="sig-paren">(</span><a class="reference internal" href="type.html#c.PyTypeObject" title="PyTypeObject">PyTypeObject</a><em> *type</em>, <a class="reference internal" href="#c.PyStructSequence_Desc" title="PyStructSequence_Desc">PyStructSequence_Desc</a><em> *desc</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyStructSequence_InitType" title="Permalink to this definition">¶</a></dt>
230
<dd><p>Initializes a struct sequence type <em>type</em> from <em>desc</em> in place.</p>
233
<dl class="function">
234
<dt id="c.PyStructSequence_InitType2">
235
int <code class="descname">PyStructSequence_InitType2</code><span class="sig-paren">(</span><a class="reference internal" href="type.html#c.PyTypeObject" title="PyTypeObject">PyTypeObject</a><em> *type</em>, <a class="reference internal" href="#c.PyStructSequence_Desc" title="PyStructSequence_Desc">PyStructSequence_Desc</a><em> *desc</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyStructSequence_InitType2" title="Permalink to this definition">¶</a></dt>
236
<dd><p>The same as <code class="docutils literal"><span class="pre">PyStructSequence_InitType</span></code>, but returns <code class="docutils literal"><span class="pre">0</span></code> on success and <code class="docutils literal"><span class="pre">-1</span></code> on
238
<div class="versionadded">
239
<p><span class="versionmodified">New in version 3.4.</span></p>
244
<dt id="c.PyStructSequence_Desc">
245
<code class="descname">PyStructSequence_Desc</code><a class="headerlink" href="#c.PyStructSequence_Desc" title="Permalink to this definition">¶</a></dt>
246
<dd><p>Contains the meta information of a struct sequence type to create.</p>
247
<table border="1" class="docutils">
253
<thead valign="bottom">
254
<tr class="row-odd"><th class="head">Field</th>
255
<th class="head">C Type</th>
256
<th class="head">Meaning</th>
260
<tr class="row-even"><td><code class="docutils literal"><span class="pre">name</span></code></td>
261
<td><code class="docutils literal"><span class="pre">char</span> <span class="pre">*</span></code></td>
262
<td>name of the struct sequence type</td>
264
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">doc</span></code></td>
265
<td><code class="docutils literal"><span class="pre">char</span> <span class="pre">*</span></code></td>
266
<td>pointer to docstring for the type
269
<tr class="row-even"><td><code class="docutils literal"><span class="pre">fields</span></code></td>
270
<td><code class="docutils literal"><span class="pre">PyStructSequence_Field</span> <span class="pre">*</span></code></td>
271
<td>pointer to <em>NULL</em>-terminated array
272
with field names of the new type</td>
274
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">n_in_sequence</span></code></td>
275
<td><code class="docutils literal"><span class="pre">int</span></code></td>
276
<td>number of fields visible to the
277
Python side (if used as tuple)</td>
284
<dt id="c.PyStructSequence_Field">
285
<code class="descname">PyStructSequence_Field</code><a class="headerlink" href="#c.PyStructSequence_Field" title="Permalink to this definition">¶</a></dt>
286
<dd><p>Describes a field of a struct sequence. As a struct sequence is modeled as a
287
tuple, all fields are typed as <a class="reference internal" href="structures.html#c.PyObject" title="PyObject"><code class="xref c c-type docutils literal"><span class="pre">PyObject*</span></code></a>. The index in the
288
<code class="xref py py-attr docutils literal"><span class="pre">fields</span></code> array of the <a class="reference internal" href="#c.PyStructSequence_Desc" title="PyStructSequence_Desc"><code class="xref c c-type docutils literal"><span class="pre">PyStructSequence_Desc</span></code></a> determines which
289
field of the struct sequence is described.</p>
290
<table border="1" class="docutils">
296
<thead valign="bottom">
297
<tr class="row-odd"><th class="head">Field</th>
298
<th class="head">C Type</th>
299
<th class="head">Meaning</th>
303
<tr class="row-even"><td><code class="docutils literal"><span class="pre">name</span></code></td>
304
<td><code class="docutils literal"><span class="pre">char</span> <span class="pre">*</span></code></td>
305
<td>name for the field or <em>NULL</em> to end
306
the list of named fields, set to
307
PyStructSequence_UnnamedField to
310
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">doc</span></code></td>
311
<td><code class="docutils literal"><span class="pre">char</span> <span class="pre">*</span></code></td>
312
<td>field docstring or <em>NULL</em> to omit</td>
319
<dt id="c.PyStructSequence_UnnamedField">
320
char* <code class="descname">PyStructSequence_UnnamedField</code><a class="headerlink" href="#c.PyStructSequence_UnnamedField" title="Permalink to this definition">¶</a></dt>
321
<dd><p>Special value for a field name to leave it unnamed.</p>
324
<dl class="function">
325
<dt id="c.PyStructSequence_New">
326
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyStructSequence_New</code><span class="sig-paren">(</span><a class="reference internal" href="type.html#c.PyTypeObject" title="PyTypeObject">PyTypeObject</a><em> *type</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyStructSequence_New" title="Permalink to this definition">¶</a></dt>
327
<dd><p>Creates an instance of <em>type</em>, which must have been created with
328
<a class="reference internal" href="#c.PyStructSequence_NewType" title="PyStructSequence_NewType"><code class="xref c c-func docutils literal"><span class="pre">PyStructSequence_NewType()</span></code></a>.</p>
331
<dl class="function">
332
<dt id="c.PyStructSequence_GetItem">
333
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyStructSequence_GetItem</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *p</em>, Py_ssize_t<em> pos</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyStructSequence_GetItem" title="Permalink to this definition">¶</a></dt>
334
<dd><p>Return the object at position <em>pos</em> in the struct sequence pointed to by <em>p</em>.
335
No bounds checking is performed.</p>
338
<dl class="function">
339
<dt id="c.PyStructSequence_GET_ITEM">
340
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyStructSequence_GET_ITEM</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *p</em>, Py_ssize_t<em> pos</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyStructSequence_GET_ITEM" title="Permalink to this definition">¶</a></dt>
341
<dd><p>Macro equivalent of <a class="reference internal" href="#c.PyStructSequence_GetItem" title="PyStructSequence_GetItem"><code class="xref c c-func docutils literal"><span class="pre">PyStructSequence_GetItem()</span></code></a>.</p>
344
<dl class="function">
345
<dt id="c.PyStructSequence_SetItem">
346
void <code class="descname">PyStructSequence_SetItem</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *p</em>, Py_ssize_t<em> pos</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *o</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyStructSequence_SetItem" title="Permalink to this definition">¶</a></dt>
347
<dd><p>Sets the field at index <em>pos</em> of the struct sequence <em>p</em> to value <em>o</em>. Like
348
<a class="reference internal" href="#c.PyTuple_SET_ITEM" title="PyTuple_SET_ITEM"><code class="xref c c-func docutils literal"><span class="pre">PyTuple_SET_ITEM()</span></code></a>, this should only be used to fill in brand new
350
<div class="admonition note">
351
<p class="first admonition-title">Note</p>
352
<p class="last">This function “steals” a reference to <em>o</em>.</p>
356
<dl class="function">
357
<dt id="c.PyStructSequence_SET_ITEM">
358
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyStructSequence_SET_ITEM</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *p</em>, Py_ssize_t<em> *pos</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *o</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyStructSequence_SET_ITEM" title="Permalink to this definition">¶</a></dt>
359
<dd><p>Macro equivalent of <a class="reference internal" href="#c.PyStructSequence_SetItem" title="PyStructSequence_SetItem"><code class="xref c c-func docutils literal"><span class="pre">PyStructSequence_SetItem()</span></code></a>.</p>
360
<div class="admonition note">
361
<p class="first admonition-title">Note</p>
362
<p class="last">This function “steals” a reference to <em>o</em>.</p>
372
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
373
<div class="sphinxsidebarwrapper">
374
<h3><a href="../contents.html">Table Of Contents</a></h3>
376
<li><a class="reference internal" href="#">Tuple Objects</a></li>
377
<li><a class="reference internal" href="#struct-sequence-objects">Struct Sequence Objects</a></li>
380
<h4>Previous topic</h4>
381
<p class="topless"><a href="unicode.html"
382
title="previous chapter">Unicode Objects and Codecs</a></p>
384
<p class="topless"><a href="list.html"
385
title="next chapter">List Objects</a></p>
386
<div role="note" aria-label="source link">
388
<ul class="this-page-menu">
389
<li><a href="../bugs.html">Report a Bug</a></li>
390
<li><a href="../_sources/c-api/tuple.txt"
391
rel="nofollow">Show Source</a></li>
396
<div class="clearer"></div>
398
<div class="related" role="navigation" aria-label="related navigation">
401
<li class="right" style="margin-right: 10px">
402
<a href="../genindex.html" title="General Index"
405
<a href="../py-modindex.html" title="Python Module Index"
408
<a href="list.html" title="List Objects"
411
<a href="unicode.html" title="Unicode Objects and Codecs"
413
<li><img src="../_static/py.png" alt=""
414
style="vertical-align: middle; margin-top: -1px"/></li>
415
<li><a href="https://www.python.org/">Python</a> »</li>
417
<span class="version_switcher_placeholder">3.5.2</span>
418
<a href="../index.html">Documentation </a> »
421
<li class="nav-item nav-item-1"><a href="index.html" >Python/C API Reference Manual</a> »</li>
422
<li class="nav-item nav-item-2"><a href="concrete.html" >Concrete Objects Layer</a> »</li>
426
<div class="inline-search" style="display: none" role="search">
427
<form class="inline-search" action="../search.html" method="get">
428
<input placeholder="Quick search" type="text" name="q" />
429
<input type="submit" value="Go" />
430
<input type="hidden" name="check_keywords" value="yes" />
431
<input type="hidden" name="area" value="default" />
434
<script type="text/javascript">$('.inline-search').show(0);</script>
441
© <a href="../copyright.html">Copyright</a> 2001-2016, Python Software Foundation.
443
The Python Software Foundation is a non-profit corporation.
444
<a href="https://www.python.org/psf/donations/">Please donate.</a>
446
Last updated on Sep 23, 2016.
447
<a href="../bugs.html">Found a bug</a>?
449
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.3.3.
b'\\ No newline at end of file'