7.2.5.2 Complex Numbers as Python Objects

Python PEP

7.2.5.2 Complex Numbers as Python Objects

This subtype of PyObject represents a Python complex number object.

This instance of PyTypeObject represents the Python complex number type.

Returns true if its argument is a PyComplexObject or a subtype of PyComplexObject. Changed in version 2.2: Allowed subtypes to be accepted.

Returns true if its argument is a PyComplexObject, but not a subtype of PyComplexObject. New in version 2.2.

Return value: New reference.
Create a new Python complex number object from a C Py_complex value.

Return value: New reference.
Returns a new PyComplexObject object from real and imag.

Returns the real part of op as a C double.

Returns the imaginary part of op as a C double.

Returns the Py_complex value of the complex number op.

See About this document... for information on suggesting changes.