[issue16899] Add support for C99 complex type (_Complex) as ctypes.c_complex

Armin Rigo report at bugs.python.org
Sun Jan 29 17:23:09 EST 2017


Armin Rigo added the comment:

* Tom: the issue is unrelated to cffi, but both ctypes and cffi could proceed to support C complexes, now that libffi support has been added.

* Mark: the problem is that the text you quote from the C standard fixes the representation of a complex in memory, but doesn't say anything about directly passing a complex as argument or return value to a function call.  Platforms use custom ways to do that.  The text you quote says a complex is an array of two real numbers; but passing an array as argument to a function works by passing a pointer to the first element.  Typically, this is not how complexes are passed: instead, some pointerless form of "passing two real numbers" is used.

----------
nosy: +arigo

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16899>
_______________________________________


More information about the Python-bugs-list mailing list