summaryrefslogtreecommitdiff
path: root/devdocs/python~3.12/c-api%2Fbool.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/python~3.12/c-api%2Fbool.html
new repository
Diffstat (limited to 'devdocs/python~3.12/c-api%2Fbool.html')
-rw-r--r--devdocs/python~3.12/c-api%2Fbool.html27
1 files changed, 27 insertions, 0 deletions
diff --git a/devdocs/python~3.12/c-api%2Fbool.html b/devdocs/python~3.12/c-api%2Fbool.html
new file mode 100644
index 00000000..fefc0033
--- /dev/null
+++ b/devdocs/python~3.12/c-api%2Fbool.html
@@ -0,0 +1,27 @@
+ <span id="boolobjects"></span><h1>Boolean Objects</h1> <p>Booleans in Python are implemented as a subclass of integers. There are only two booleans, <a class="reference internal" href="#c.Py_False" title="Py_False"><code>Py_False</code></a> and <a class="reference internal" href="#c.Py_True" title="Py_True"><code>Py_True</code></a>. As such, the normal creation and deletion functions don’t apply to booleans. The following macros are available, however.</p> <dl class="c var"> <dt class="sig sig-object c" id="c.PyBool_Type">
+<code>PyTypeObject PyBool_Type</code> </dt> <dd>
+<em class="stableabi"> Part of the <a class="reference internal" href="stable#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>This instance of <a class="reference internal" href="type#c.PyTypeObject" title="PyTypeObject"><code>PyTypeObject</code></a> represents the Python boolean type; it is the same object as <a class="reference internal" href="../library/functions#bool" title="bool"><code>bool</code></a> in the Python layer.</p> </dd>
+</dl> <dl class="c function"> <dt class="sig sig-object c" id="c.PyBool_Check">
+<code>int PyBool_Check(PyObject *o)</code> </dt> <dd>
+<p>Return true if <em>o</em> is of type <a class="reference internal" href="#c.PyBool_Type" title="PyBool_Type"><code>PyBool_Type</code></a>. This function always succeeds.</p> </dd>
+</dl> <dl class="c var"> <dt class="sig sig-object c" id="c.Py_False">
+<code>PyObject *Py_False</code> </dt> <dd>
+<p>The Python <code>False</code> object. 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_False" title="Py_False"><code>Py_False</code></a> is immortal.</p> </div> <dl class="c var"> <dt class="sig sig-object c" id="c.Py_True">
+<code>PyObject *Py_True</code> </dt> <dd>
+<p>The Python <code>True</code> object. 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_True" title="Py_True"><code>Py_True</code></a> is immortal.</p> </div> <dl class="c macro"> <dt class="sig sig-object c" id="c.Py_RETURN_FALSE">
+<code>Py_RETURN_FALSE</code> </dt> <dd>
+<p>Return <a class="reference internal" href="#c.Py_False" title="Py_False"><code>Py_False</code></a> from a function.</p> </dd>
+</dl> <dl class="c macro"> <dt class="sig sig-object c" id="c.Py_RETURN_TRUE">
+<code>Py_RETURN_TRUE</code> </dt> <dd>
+<p>Return <a class="reference internal" href="#c.Py_True" title="Py_True"><code>Py_True</code></a> from a function.</p> </dd>
+</dl> <dl class="c function"> <dt class="sig sig-object c" id="c.PyBool_FromLong">
+<code>PyObject *PyBool_FromLong(long v)</code> </dt> <dd>
+<em class="refcount">Return value: New reference.</em><em class="stableabi"> Part of the <a class="reference internal" href="stable#stable"><span class="std std-ref">Stable ABI</span></a>.</em><p>Return <a class="reference internal" href="#c.Py_True" title="Py_True"><code>Py_True</code></a> or <a class="reference internal" href="#c.Py_False" title="Py_False"><code>Py_False</code></a>, depending on the truth value of <em>v</em>.</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/bool.html" class="_attribution-link">https://docs.python.org/3.12/c-api/bool.html</a>
+ </p>
+</div>