GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Capsules
  • Frame objects
  • Report a bug
  • Improve this page
  • Show source
  • index
  • modules
  • Python
  • 3.16.0a2 documentation
  • Python/C API reference manual
  • Concrete Objects Layer
  • Sentinel objects

This view

  • Original page
  • New address

GeezerVison is showing docs.python.org — Sentinel objects

Sentinel objects¶

PyTypeObject PySentinel_Type¶

This instance of PyTypeObject represents the Python sentinel type. This is the same object as sentinel.

Added in version 3.15.

int PySentinel_Check(PyObject *o)¶

Return true if o is a sentinel object or a subtype. The sentinel type does not currently allow subclasses, so this check is exact. Future Python versions may choose to allow subtyping. This function always succeeds.

Added in version 3.15.

int PySentinel_CheckExact(PyObject *o)¶

Return true if o is a sentinel object, but not a subtype. The sentinel type does not currently allow subclasses. Future Python versions may choose to allow subtyping. This function always succeeds.

Added in version 3.15.

PyObject *PySentinel_New(const char *name, const char *module_name, const char *repr)¶
Return value: New reference.

Return a new sentinel object with __name__ set to name and __module__ set to module_name. name must not be NULL. If module_name is NULL, __module__ is set to None. If repr is NULL, repr() returns __name__. Return NULL with an exception set on failure.

For pickling to work, module_name must be the name of an importable module, and the sentinel must be accessible from that module under a path matching name. Pickle treats name as a global variable name in module_name (see object.__reduce__()).

Added in version 3.15.

© Copyright 2001 Python Software Foundation.
This page is licensed under the Python Software Foundation License Version 2.
Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.
See History and License for more information.

The Python Software Foundation is a non-profit corporation. Please donate.

Last updated on Nov 12, 2026 (14:14 UTC). Found a bug?
Created using Sphinx 9.1.1.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.