summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/none.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-01-19 22:08:21 (GMT)
committerGeorg Brandl <georg@python.org>2008-01-19 22:08:21 (GMT)
commitf6842722df69a40e841c045d42a538bb5d6bbbf6 (patch)
tree2b8bb1b6bb5908ed66ed72f7c84de0a34ddc7542 /Doc/c-api/none.rst
parent8b506e7a2d4e8cb6ffd6b7f2845e45aa92daa4d4 (diff)
downloadcpython-f6842722df69a40e841c045d42a538bb5d6bbbf6.zip
cpython-f6842722df69a40e841c045d42a538bb5d6bbbf6.tar.gz
cpython-f6842722df69a40e841c045d42a538bb5d6bbbf6.tar.bz2
Split the monstrous C API manual files in smaller parts.
Diffstat (limited to 'Doc/c-api/none.rst')
-rw-r--r--Doc/c-api/none.rst28
1 files changed, 28 insertions, 0 deletions
diff --git a/Doc/c-api/none.rst b/Doc/c-api/none.rst
new file mode 100644
index 0000000..1bb603e
--- /dev/null
+++ b/Doc/c-api/none.rst
@@ -0,0 +1,28 @@
+.. highlightlang:: c
+
+.. _noneobject:
+
+The None Object
+---------------
+
+.. index:: object: None
+
+Note that the :ctype:`PyTypeObject` for ``None`` is not directly exposed in the
+Python/C API. Since ``None`` is a singleton, testing for object identity (using
+``==`` in C) is sufficient. There is no :cfunc:`PyNone_Check` function for the
+same reason.
+
+
+.. cvar:: PyObject* Py_None
+
+ The Python ``None`` object, denoting lack of value. This object has no methods.
+ It needs to be treated just like any other object with respect to reference
+ counts.
+
+
+.. cmacro:: Py_RETURN_NONE
+
+ Properly handle returning :cdata:`Py_None` from within a C function.
+
+ .. versionadded:: 2.4
+