summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-04-10 22:17:39 (GMT)
committerGitHub <noreply@github.com>2021-04-10 22:17:39 (GMT)
commit09bbebea163fe7303264cf4069c51d4d2f22fde4 (patch)
treeaf9449e38983bab8ebf5a667c149cb0d33e05543 /Misc
parent6e468cb16bde483ad73c1eb13b20a08d74e30846 (diff)
downloadcpython-09bbebea163fe7303264cf4069c51d4d2f22fde4.zip
cpython-09bbebea163fe7303264cf4069c51d4d2f22fde4.tar.gz
cpython-09bbebea163fe7303264cf4069c51d4d2f22fde4.tar.bz2
bpo-43753: Add Py_Is() and Py_IsNone() functions (GH-25227)
Add the Py_Is(x, y) function to test if the 'x' object is the 'y' object, the same as "x is y" in Python. Add also the Py_IsNone(), Py_IsTrue(), Py_IsFalse() functions to test if an object is, respectively, the None singleton, the True singleton or the False singleton.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/C API/2021-04-06-20-52-44.bpo-43753.xUsHp1.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/C API/2021-04-06-20-52-44.bpo-43753.xUsHp1.rst b/Misc/NEWS.d/next/C API/2021-04-06-20-52-44.bpo-43753.xUsHp1.rst
new file mode 100644
index 0000000..f0eac4c
--- /dev/null
+++ b/Misc/NEWS.d/next/C API/2021-04-06-20-52-44.bpo-43753.xUsHp1.rst
@@ -0,0 +1,6 @@
+Add the :c:func:`Py_Is(x, y) <Py_Is>` function to test if the *x* object is the
+*y* object, the same as ``x is y`` in Python. Add also the :c:func:`Py_IsNone`,
+:c:func:`Py_IsTrue`, :c:func:`Py_IsFalse` functions to test if an object is,
+respectively, the ``None`` singleton, the ``True`` singleton or the ``False``
+singleton.
+Patch by Victor Stinner.