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>Descriptor Objects — Python 2.7.11 documentation</title>
11
<link rel="stylesheet" href="../_static/classic.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 2.7.11 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 2.7.11 documentation" href="../contents.html" />
33
<link rel="up" title="Concrete Objects Layer" href="concrete.html" />
34
<link rel="next" title="Slice Objects" href="slice.html" />
35
<link rel="prev" title="Iterator Objects" href="iterator.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="slice.html" title="Slice Objects"
55
accesskey="N">next</a> |</li>
57
<a href="iterator.html" title="Iterator Objects"
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">2.7.11</span>
64
<a href="../index.html">Documentation</a> »
67
<li class="nav-item nav-item-1"><a href="index.html" >Python/C API Reference Manual</a> »</li>
68
<li class="nav-item nav-item-2"><a href="concrete.html" accesskey="U">Concrete Objects Layer</a> »</li>
72
<div class="document">
73
<div class="documentwrapper">
74
<div class="bodywrapper">
75
<div class="body" role="main">
77
<div class="section" id="descriptor-objects">
78
<span id="id1"></span><h1>Descriptor Objects<a class="headerlink" href="#descriptor-objects" title="Permalink to this headline">¶</a></h1>
79
<p>“Descriptors” are objects that describe some attribute of an object. They are
80
found in the dictionary of type objects.</p>
82
<dt id="c.PyProperty_Type">
83
<a class="reference internal" href="type.html#c.PyTypeObject" title="PyTypeObject">PyTypeObject</a> <code class="descname">PyProperty_Type</code><a class="headerlink" href="#c.PyProperty_Type" title="Permalink to this definition">¶</a></dt>
84
<dd><p>The type object for the built-in descriptor types.</p>
85
<div class="versionadded">
86
<p><span class="versionmodified">New in version 2.2.</span></p>
91
<dt id="c.PyDescr_NewGetSet">
92
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyDescr_NewGetSet</code><span class="sig-paren">(</span><a class="reference internal" href="type.html#c.PyTypeObject" title="PyTypeObject">PyTypeObject</a><em> *type</em>, struct PyGetSetDef<em> *getset</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDescr_NewGetSet" title="Permalink to this definition">¶</a></dt>
93
<dd><em class="refcount">Return value: New reference.</em><div class="versionadded">
94
<p><span class="versionmodified">New in version 2.2.</span></p>
99
<dt id="c.PyDescr_NewMember">
100
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyDescr_NewMember</code><span class="sig-paren">(</span><a class="reference internal" href="type.html#c.PyTypeObject" title="PyTypeObject">PyTypeObject</a><em> *type</em>, struct <a class="reference internal" href="structures.html#c.PyMemberDef" title="PyMemberDef">PyMemberDef</a><em> *meth</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDescr_NewMember" title="Permalink to this definition">¶</a></dt>
101
<dd><em class="refcount">Return value: New reference.</em><div class="versionadded">
102
<p><span class="versionmodified">New in version 2.2.</span></p>
106
<dl class="function">
107
<dt id="c.PyDescr_NewMethod">
108
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyDescr_NewMethod</code><span class="sig-paren">(</span><a class="reference internal" href="type.html#c.PyTypeObject" title="PyTypeObject">PyTypeObject</a><em> *type</em>, struct <a class="reference internal" href="structures.html#c.PyMethodDef" title="PyMethodDef">PyMethodDef</a><em> *meth</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDescr_NewMethod" title="Permalink to this definition">¶</a></dt>
109
<dd><em class="refcount">Return value: New reference.</em><div class="versionadded">
110
<p><span class="versionmodified">New in version 2.2.</span></p>
114
<dl class="function">
115
<dt id="c.PyDescr_NewWrapper">
116
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyDescr_NewWrapper</code><span class="sig-paren">(</span><a class="reference internal" href="type.html#c.PyTypeObject" title="PyTypeObject">PyTypeObject</a><em> *type</em>, struct wrapperbase<em> *wrapper</em>, void<em> *wrapped</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDescr_NewWrapper" title="Permalink to this definition">¶</a></dt>
117
<dd><em class="refcount">Return value: New reference.</em><div class="versionadded">
118
<p><span class="versionmodified">New in version 2.2.</span></p>
122
<dl class="function">
123
<dt id="c.PyDescr_NewClassMethod">
124
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyDescr_NewClassMethod</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="structures.html#c.PyMethodDef" title="PyMethodDef">PyMethodDef</a><em> *method</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDescr_NewClassMethod" title="Permalink to this definition">¶</a></dt>
125
<dd><em class="refcount">Return value: New reference.</em><div class="versionadded">
126
<p><span class="versionmodified">New in version 2.3.</span></p>
130
<dl class="function">
131
<dt id="c.PyDescr_IsData">
132
int <code class="descname">PyDescr_IsData</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *descr</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyDescr_IsData" title="Permalink to this definition">¶</a></dt>
133
<dd><p>Return true if the descriptor objects <em>descr</em> describes a data attribute, or
134
false if it describes a method. <em>descr</em> must be a descriptor object; there is
135
no error checking.</p>
136
<div class="versionadded">
137
<p><span class="versionmodified">New in version 2.2.</span></p>
141
<dl class="function">
142
<dt id="c.PyWrapper_New">
143
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyWrapper_New</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyWrapper_New" title="Permalink to this definition">¶</a></dt>
144
<dd><em class="refcount">Return value: New reference.</em><div class="versionadded">
145
<p><span class="versionmodified">New in version 2.2.</span></p>
155
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
156
<div class="sphinxsidebarwrapper">
157
<h4>Previous topic</h4>
158
<p class="topless"><a href="iterator.html"
159
title="previous chapter">Iterator Objects</a></p>
161
<p class="topless"><a href="slice.html"
162
title="next chapter">Slice Objects</a></p>
164
<ul class="this-page-menu">
165
<li><a href="../bugs.html">Report a Bug</a></li>
166
<li><a href="../_sources/c-api/descriptor.txt"
167
rel="nofollow">Show Source</a></li>
170
<div id="searchbox" style="display: none" role="search">
171
<h3>Quick search</h3>
172
<form class="search" action="../search.html" method="get">
173
<input type="text" name="q" />
174
<input type="submit" value="Go" />
175
<input type="hidden" name="check_keywords" value="yes" />
176
<input type="hidden" name="area" value="default" />
178
<p class="searchtip" style="font-size: 90%">
179
Enter search terms or a module, class or function name.
182
<script type="text/javascript">$('#searchbox').show(0);</script>
185
<div class="clearer"></div>
187
<div class="related" role="navigation" aria-label="related navigation">
190
<li class="right" style="margin-right: 10px">
191
<a href="../genindex.html" title="General Index"
194
<a href="../py-modindex.html" title="Python Module Index"
197
<a href="slice.html" title="Slice Objects"
200
<a href="iterator.html" title="Iterator Objects"
202
<li><img src="../_static/py.png" alt=""
203
style="vertical-align: middle; margin-top: -1px"/></li>
204
<li><a href="https://www.python.org/">Python</a> »</li>
206
<span class="version_switcher_placeholder">2.7.11</span>
207
<a href="../index.html">Documentation</a> »
210
<li class="nav-item nav-item-1"><a href="index.html" >Python/C API Reference Manual</a> »</li>
211
<li class="nav-item nav-item-2"><a href="concrete.html" >Concrete Objects Layer</a> »</li>
215
© <a href="../copyright.html">Copyright</a> 1990-2016, Python Software Foundation.
217
The Python Software Foundation is a non-profit corporation.
218
<a href="https://www.python.org/psf/donations/">Please donate.</a>
220
Last updated on Jan 23, 2016.
221
<a href="../bugs.html">Found a bug</a>?
223
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.3.3.
b'\\ No newline at end of file'