picop.cysentinel#
Fast sentinel helpers (CPython 3.15+).
- picop.cysentinel.sentinel_check(obj)#
Return True if
objis a sentinel.Notes
The sentinel type cannot be subclassed, so
sentinel_checkandsentinel_check_exactagree on every value.
- picop.cysentinel.sentinel_check_exact(obj)#
Return True if
objis exactly a sentinel (subtypes excluded).
- picop.cysentinel.sentinel_new(name, module=None, repr=None)#
Return a newly created sentinel named
name.Notes
Unlike the builtin
sentinelconstructor,moduleandreprdefault toNonerather than being inferred. Embedded NUL characters raiseValueError(the C API is NUL-terminated) and unpaired surrogates raiseUnicodeEncodeError. RaisesNotImplementedErroron 3.14.