Navigation
- index
- modules |
- next |
- previous |
- Python »
- 3.16.0a2 documentation »
- Python/C API reference manual »
- Concrete Objects Layer »
- Sentinel objects
- |
- Theme |
Sentinel objects¶
-
PyTypeObject PySentinel_Type¶
This instance of
PyTypeObjectrepresents the Pythonsentineltype. This is the same object assentinel.Added in version 3.15.
-
int PySentinel_Check(PyObject *o)¶
Return true if o is a
sentinelobject or a subtype. Thesentineltype 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
sentinelobject, but not a subtype. Thesentineltype 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
sentinelobject with__name__set to name and__module__set to module_name. name must not beNULL. If module_name isNULL,__module__is set toNone. If repr isNULL,repr()returns__name__. ReturnNULLwith 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.
Previous topic
Next topic
This page
«Navigation
- index
- modules |
- next |
- previous |
- Python »
- 3.16.0a2 documentation »
- Python/C API reference manual »
- Concrete Objects Layer »
- Sentinel objects
- |
- Theme |
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 29, 2026 (04:54 UTC). Found a bug?
Created using Sphinx 9.1.1.