Objetos sentinel

PyTypeObject PySentinel_Type

Esta instância do PyTypeObject representa o tipo sentinel do Python. Este é o mesmo objeto que sentinel.

Adicionado na versão 3.15.

int PySentinel_Check(PyObject *o)

Return true if o is a sentinel object. The sentinel type does not allow subclasses, so this check is exact.

Adicionado na versão 3.15.

PyObject *PySentinel_New(const char *name, const char *module_name)
Retorna valor: Nova referência.

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. 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__()).

Adicionado na versão 3.15.