/Doc/c-api/none.rst

http://unladen-swallow.googlecode.com/ · ReStructuredText · 28 lines · 16 code · 12 blank · 0 comment · 0 complexity · bffc93d66f4f0d85ed11cb9d27db7408 MD5 · raw file

  1. .. highlightlang:: c
  2. .. _noneobject:
  3. The None Object
  4. ---------------
  5. .. index:: object: None
  6. Note that the :ctype:`PyTypeObject` for ``None`` is not directly exposed in the
  7. Python/C API. Since ``None`` is a singleton, testing for object identity (using
  8. ``==`` in C) is sufficient. There is no :cfunc:`PyNone_Check` function for the
  9. same reason.
  10. .. cvar:: PyObject* Py_None
  11. The Python ``None`` object, denoting lack of value. This object has no methods.
  12. It needs to be treated just like any other object with respect to reference
  13. counts.
  14. .. cmacro:: Py_RETURN_NONE
  15. Properly handle returning :cdata:`Py_None` from within a C function.
  16. .. versionadded:: 2.4