Skip to content

Improve complex C-API error descriptions #121834

@sobolevn

Description

@sobolevn

There several things to improve:

  • Some functions do not have an error description at all:
    .. c:function:: PyObject* PyComplex_FromCComplex(Py_complex v)
    Create a new Python complex number object from a C :c:type:`Py_complex` value.
    .. c:function:: PyObject* PyComplex_FromDoubles(double real, double imag)
    Return a new :c:type:`PyComplexObject` object from *real* and *imag*.
    So, we should add that these functions can fail.
  • Some functions mention the error case, but do not mention that exception is set:
    to :meth:`~object.__index__`. Upon failure, this method returns ``-1.0`` as a real
    value.

Plus, I would unify the wording in some other functions.

Linked PRs

Metadata

Metadata

Assignees

Labels

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions