summaryrefslogtreecommitdiff
path: root/devdocs/python~3.12/c-api%2Fnone.html
blob: e34a1fee5f5ffcf77c3c8e41dd0addf57430c316 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
 <span id="noneobject"></span><h1>The None Object</h1> <p id="index-0">Note that the <a class="reference internal" href="type#c.PyTypeObject" title="PyTypeObject"><code>PyTypeObject</code></a> for <code>None</code> is not directly exposed in the Python/C API. Since <code>None</code> is a singleton, testing for object identity (using <code>==</code> in C) is sufficient. There is no <code>PyNone_Check()</code> function for the same reason.</p> <dl class="c var"> <dt class="sig sig-object c" id="c.Py_None">
<code>PyObject *Py_None</code> </dt> <dd>
<p>The Python <code>None</code> object, denoting lack of value. This object has no methods and is <a class="reference external" href="https://peps.python.org/pep-0683/">immortal</a>.</p> </dd>
</dl> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.12: </span><a class="reference internal" href="#c.Py_None" title="Py_None"><code>Py_None</code></a> is immortal.</p> </div> <dl class="c macro"> <dt class="sig sig-object c" id="c.Py_RETURN_NONE">
<code>Py_RETURN_NONE</code> </dt> <dd>
<p>Return <a class="reference internal" href="#c.Py_None" title="Py_None"><code>Py_None</code></a> from a function.</p> </dd>
</dl> <div class="_attribution">
  <p class="_attribution-p">
    &copy; 2001&ndash;2023 Python Software Foundation<br>Licensed under the PSF License.<br>
    <a href="https://docs.python.org/3.12/c-api/none.html" class="_attribution-link">https://docs.python.org/3.12/c-api/none.html</a>
  </p>
</div>