.. c:function:: int PyBool_Check(PyObject *o)
- Return true if *o* is of type :c:data:`PyBool_Type`.
+ Return true if *o* is of type :c:data:`PyBool_Type`. This function always
+ succeeds.
.. c:var:: PyObject* Py_False
.. c:function:: int PyByteArray_Check(PyObject *o)
Return true if the object *o* is a bytearray object or an instance of a
- subtype of the bytearray type.
+ subtype of the bytearray type. This function always succeeds.
.. c:function:: int PyByteArray_CheckExact(PyObject *o)
Return true if the object *o* is a bytearray object, but not an instance of a
- subtype of the bytearray type.
+ subtype of the bytearray type. This function always succeeds.
Direct API functions
.. c:function:: int PyBytes_Check(PyObject *o)
Return true if the object *o* is a bytes object or an instance of a subtype
- of the bytes type.
+ of the bytes type. This function always succeeds.
.. c:function:: int PyBytes_CheckExact(PyObject *o)
Return true if the object *o* is a bytes object, but not an instance of a
- subtype of the bytes type.
+ subtype of the bytes type. This function always succeeds.
.. c:function:: PyObject* PyBytes_FromString(const char *v)
.. c:function:: int PyCapsule_CheckExact(PyObject *p)
- Return true if its argument is a :c:type:`PyCapsule`.
+ Return true if its argument is a :c:type:`PyCapsule`. This function always
+ succeeds.
.. c:function:: PyObject* PyCapsule_New(void *pointer, const char *name, PyCapsule_Destructor destructor)
.. c:function:: int PyCell_Check(ob)
- Return true if *ob* is a cell object; *ob* must not be ``NULL``.
+ Return true if *ob* is a cell object; *ob* must not be ``NULL``. This
+ function always succeeds.
.. c:function:: PyObject* PyCell_New(PyObject *ob)
.. c:function:: int PyCode_Check(PyObject *co)
- Return true if *co* is a :class:`code` object.
+ Return true if *co* is a :class:`code` object. This function always succeeds.
.. c:function:: int PyCode_GetNumFree(PyCodeObject *co)
.. c:function:: int PyComplex_Check(PyObject *p)
Return true if its argument is a :c:type:`PyComplexObject` or a subtype of
- :c:type:`PyComplexObject`.
+ :c:type:`PyComplexObject`. This function always succeeds.
.. c:function:: int PyComplex_CheckExact(PyObject *p)
Return true if its argument is a :c:type:`PyComplexObject`, but not a subtype of
- :c:type:`PyComplexObject`.
+ :c:type:`PyComplexObject`. This function always succeeds.
.. c:function:: PyObject* PyComplex_FromCComplex(Py_complex v)
.. c:function:: int PyCoro_CheckExact(PyObject *ob)
Return true if *ob*'s type is :c:type:`PyCoro_Type`; *ob* must not be ``NULL``.
+ This function always succeeds.
.. c:function:: PyObject* PyCoro_New(PyFrameObject *frame, PyObject *name, PyObject *qualname)
.. c:function:: int PyDate_Check(PyObject *ob)
Return true if *ob* is of type :c:data:`PyDateTime_DateType` or a subtype of
- :c:data:`PyDateTime_DateType`. *ob* must not be ``NULL``.
+ :c:data:`PyDateTime_DateType`. *ob* must not be ``NULL``. This function always
+ succeeds.
.. c:function:: int PyDate_CheckExact(PyObject *ob)
Return true if *ob* is of type :c:data:`PyDateTime_DateType`. *ob* must not be
- ``NULL``.
+ ``NULL``. This function always succeeds.
.. c:function:: int PyDateTime_Check(PyObject *ob)
Return true if *ob* is of type :c:data:`PyDateTime_DateTimeType` or a subtype of
- :c:data:`PyDateTime_DateTimeType`. *ob* must not be ``NULL``.
+ :c:data:`PyDateTime_DateTimeType`. *ob* must not be ``NULL``. This function always
+ succeeds.
.. c:function:: int PyDateTime_CheckExact(PyObject *ob)
Return true if *ob* is of type :c:data:`PyDateTime_DateTimeType`. *ob* must not
- be ``NULL``.
+ be ``NULL``. This function always succeeds.
.. c:function:: int PyTime_Check(PyObject *ob)
Return true if *ob* is of type :c:data:`PyDateTime_TimeType` or a subtype of
- :c:data:`PyDateTime_TimeType`. *ob* must not be ``NULL``.
+ :c:data:`PyDateTime_TimeType`. *ob* must not be ``NULL``. This function always
+ succeeds.
.. c:function:: int PyTime_CheckExact(PyObject *ob)
Return true if *ob* is of type :c:data:`PyDateTime_TimeType`. *ob* must not be
- ``NULL``.
+ ``NULL``. This function always succeeds.
.. c:function:: int PyDelta_Check(PyObject *ob)
Return true if *ob* is of type :c:data:`PyDateTime_DeltaType` or a subtype of
- :c:data:`PyDateTime_DeltaType`. *ob* must not be ``NULL``.
+ :c:data:`PyDateTime_DeltaType`. *ob* must not be ``NULL``. This function always
+ succeeds.
.. c:function:: int PyDelta_CheckExact(PyObject *ob)
Return true if *ob* is of type :c:data:`PyDateTime_DeltaType`. *ob* must not be
- ``NULL``.
+ ``NULL``. This function always succeeds.
.. c:function:: int PyTZInfo_Check(PyObject *ob)
Return true if *ob* is of type :c:data:`PyDateTime_TZInfoType` or a subtype of
- :c:data:`PyDateTime_TZInfoType`. *ob* must not be ``NULL``.
+ :c:data:`PyDateTime_TZInfoType`. *ob* must not be ``NULL``. This function always
+ succeeds.
.. c:function:: int PyTZInfo_CheckExact(PyObject *ob)
Return true if *ob* is of type :c:data:`PyDateTime_TZInfoType`. *ob* must not be
- ``NULL``.
+ ``NULL``. This function always succeeds.
Macros to create objects:
.. c:function:: int PyDict_Check(PyObject *p)
Return true if *p* is a dict object or an instance of a subtype of the dict
- type.
+ type. This function always succeeds.
.. c:function:: int PyDict_CheckExact(PyObject *p)
Return true if *p* is a dict object, but not an instance of a subtype of
- the dict type.
+ the dict type. This function always succeeds.
.. c:function:: PyObject* PyDict_New()
.. c:function:: int PyFloat_Check(PyObject *p)
Return true if its argument is a :c:type:`PyFloatObject` or a subtype of
- :c:type:`PyFloatObject`.
+ :c:type:`PyFloatObject`. This function always succeeds.
.. c:function:: int PyFloat_CheckExact(PyObject *p)
Return true if its argument is a :c:type:`PyFloatObject`, but not a subtype of
- :c:type:`PyFloatObject`.
+ :c:type:`PyFloatObject`. This function always succeeds.
.. c:function:: PyObject* PyFloat_FromString(PyObject *str)
.. c:function:: int PyFunction_Check(PyObject *o)
Return true if *o* is a function object (has type :c:data:`PyFunction_Type`).
- The parameter must not be ``NULL``.
+ The parameter must not be ``NULL``. This function always succeeds.
.. c:function:: PyObject* PyFunction_New(PyObject *code, PyObject *globals)
.. c:function:: int PyGen_Check(PyObject *ob)
- Return true if *ob* is a generator object; *ob* must not be ``NULL``.
+ Return true if *ob* is a generator object; *ob* must not be ``NULL``. This
+ function always succeeds.
.. c:function:: int PyGen_CheckExact(PyObject *ob)
- Return true if *ob*'s type is :c:type:`PyGen_Type`; *ob* must not be ``NULL``.
+ Return true if *ob*'s type is :c:type:`PyGen_Type`; *ob* must not be
+ ``NULL``. This function always succeeds.
.. c:function:: PyObject* PyGen_New(PyFrameObject *frame)
.. c:function:: int PyIter_Check(PyObject *o)
- Return true if the object *o* supports the iterator protocol.
+ Return true if the object *o* supports the iterator protocol. This
+ function always succeeds.
.. c:function:: PyObject* PyIter_Next(PyObject *o)
.. c:function:: int PySeqIter_Check(op)
- Return true if the type of *op* is :c:data:`PySeqIter_Type`.
+ Return true if the type of *op* is :c:data:`PySeqIter_Type`. This function
+ always succeeds.
.. c:function:: PyObject* PySeqIter_New(PyObject *seq)
.. c:function:: int PyCallIter_Check(op)
- Return true if the type of *op* is :c:data:`PyCallIter_Type`.
+ Return true if the type of *op* is :c:data:`PyCallIter_Type`. This
+ function always succeeds.
.. c:function:: PyObject* PyCallIter_New(PyObject *callable, PyObject *sentinel)
.. c:function:: int PyList_Check(PyObject *p)
Return true if *p* is a list object or an instance of a subtype of the list
- type.
+ type. This function always succeeds.
.. c:function:: int PyList_CheckExact(PyObject *p)
Return true if *p* is a list object, but not an instance of a subtype of
- the list type.
+ the list type. This function always succeeds.
.. c:function:: PyObject* PyList_New(Py_ssize_t len)
.. c:function:: int PyLong_Check(PyObject *p)
Return true if its argument is a :c:type:`PyLongObject` or a subtype of
- :c:type:`PyLongObject`.
+ :c:type:`PyLongObject`. This function always succeeds.
.. c:function:: int PyLong_CheckExact(PyObject *p)
Return true if its argument is a :c:type:`PyLongObject`, but not a subtype of
- :c:type:`PyLongObject`.
+ :c:type:`PyLongObject`. This function always succeeds.
.. c:function:: PyObject* PyLong_FromLong(long v)
.. c:function:: int PyMemoryView_Check(PyObject *obj)
Return true if the object *obj* is a memoryview object. It is not
- currently allowed to create subclasses of :class:`memoryview`.
+ currently allowed to create subclasses of :class:`memoryview`. This
+ function always succeeds.
.. c:function:: Py_buffer *PyMemoryView_GET_BUFFER(PyObject *mview)
Return true if *o* is an instance method object (has type
:c:data:`PyInstanceMethod_Type`). The parameter must not be ``NULL``.
+ This function always succeeds.
.. c:function:: PyObject* PyInstanceMethod_New(PyObject *func)
.. c:function:: int PyMethod_Check(PyObject *o)
Return true if *o* is a method object (has type :c:data:`PyMethod_Type`). The
- parameter must not be ``NULL``.
+ parameter must not be ``NULL``. This function always succeeds.
.. c:function:: PyObject* PyMethod_New(PyObject *func, PyObject *self)
.. c:function:: int PyModule_Check(PyObject *p)
Return true if *p* is a module object, or a subtype of a module object.
+ This function always succeeds.
.. c:function:: int PyModule_CheckExact(PyObject *p)
Return true if *p* is a module object, but not a subtype of
- :c:data:`PyModule_Type`.
+ :c:data:`PyModule_Type`. This function always succeeds.
.. c:function:: PyObject* PyModule_NewObject(PyObject *name)
.. c:function:: int PySet_Check(PyObject *p)
Return true if *p* is a :class:`set` object or an instance of a subtype.
+ This function always succeeds.
.. c:function:: int PyFrozenSet_Check(PyObject *p)
Return true if *p* is a :class:`frozenset` object or an instance of a
- subtype.
+ subtype. This function always succeeds.
.. c:function:: int PyAnySet_Check(PyObject *p)
Return true if *p* is a :class:`set` object, a :class:`frozenset` object, or an
- instance of a subtype.
+ instance of a subtype. This function always succeeds.
.. c:function:: int PyAnySet_CheckExact(PyObject *p)
Return true if *p* is a :class:`set` object or a :class:`frozenset` object but
- not an instance of a subtype.
+ not an instance of a subtype. This function always succeeds.
.. c:function:: int PyFrozenSet_CheckExact(PyObject *p)
Return true if *p* is a :class:`frozenset` object but not an instance of a
- subtype.
+ subtype. This function always succeeds.
.. c:function:: PyObject* PySet_New(PyObject *iterable)
.. c:function:: int PySlice_Check(PyObject *ob)
- Return true if *ob* is a slice object; *ob* must not be ``NULL``.
+ Return true if *ob* is a slice object; *ob* must not be ``NULL``. This
+ function always succeeds.
.. c:function:: PyObject* PySlice_New(PyObject *start, PyObject *stop, PyObject *step)
.. c:function:: int PyTuple_Check(PyObject *p)
- Return true if *p* is a tuple object or an instance of a subtype of the tuple
- type.
+ Return true if *p* is a tuple object or an instance of a subtype of the
+ tuple type. This function always succeeds.
.. c:function:: int PyTuple_CheckExact(PyObject *p)
Return true if *p* is a tuple object, but not an instance of a subtype of the
- tuple type.
+ tuple type. This function always succeeds.
.. c:function:: PyObject* PyTuple_New(Py_ssize_t len)
Return non-zero if the object *o* is a type object, including instances of
types derived from the standard type object. Return 0 in all other cases.
+ This function always succeeds.
.. c:function:: int PyType_CheckExact(PyObject *o)
- Return non-zero if the object *o* is a type object, but not a subtype of the
- standard type object. Return 0 in all other cases.
+ Return non-zero if the object *o* is a type object, but not a subtype of
+ the standard type object. Return 0 in all other cases. This function
+ always succeeds.
.. c:function:: unsigned int PyType_ClearCache()
.. c:function:: int PyUnicode_Check(PyObject *o)
Return true if the object *o* is a Unicode object or an instance of a Unicode
- subtype.
+ subtype. This function always succeeds.
.. c:function:: int PyUnicode_CheckExact(PyObject *o)
Return true if the object *o* is a Unicode object, but not an instance of a
- subtype.
+ subtype. This function always succeeds.
.. c:function:: int PyUnicode_READY(PyObject *o)
.. c:function:: int PyWeakref_Check(ob)
- Return true if *ob* is either a reference or proxy object.
+ Return true if *ob* is either a reference or proxy object. This function
+ always succeeds.
.. c:function:: int PyWeakref_CheckRef(ob)
- Return true if *ob* is a reference object.
+ Return true if *ob* is a reference object. This function always succeeds.
.. c:function:: int PyWeakref_CheckProxy(ob)
- Return true if *ob* is a proxy object.
+ Return true if *ob* is a proxy object. This function always succeeds.
.. c:function:: PyObject* PyWeakref_NewRef(PyObject *ob, PyObject *callback)