cpython/Include/cpython/sentinelobject.h
Miss Islington (bot) f5231469b5
[3.15] gh-148829: Make sentinels' repr and module customizable (GH-149654) (#150092)
Implementation of python/peps#4968.
(cherry picked from commit 08218030a5)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2026-05-22 07:44:34 -07:00

26 lines
580 B
C

/* Sentinel object interface */
#ifndef Py_LIMITED_API
#ifndef _Py_SENTINELOBJECT_H
#define _Py_SENTINELOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
PyAPI_DATA(PyTypeObject) PySentinel_Type;
#define PySentinel_CheckExact(op) Py_IS_TYPE((op), &PySentinel_Type)
/* Alias as long as subclasses are not allowed. */
#define PySentinel_Check(op) PySentinel_CheckExact(op)
PyAPI_FUNC(PyObject *) PySentinel_New(
const char *name,
const char *module_name,
const char *repr);
#ifdef __cplusplus
}
#endif
#endif /* !_Py_SENTINELOBJECT_H */
#endif /* !Py_LIMITED_API */