Bug report
Bug description:
I was working on adding support for the fancy new complex ctypes types to numpy.ctypeslib 1, but ran into the problem that the c_{float,double,longdouble}_complex types do not have the __ctype_{be,le}__ attributes that e.g. their non-complex counterparts have:
>>> import ctypes as ct
>>> ct.c_float.__ctype_le__
<class 'ctypes.c_float'>
>>> ct.c_float_complex.__ctype_le__
Traceback (most recent call last):
File "<python-input-2>", line 1, in <module>
ct.c_float_complex.__ctype_le__
AttributeError: type object 'c_float_complex' has no attribute '__ctype_le__'
I checked Python 3.14.4 and 3.15.0a8.
CPython versions tested on:
3.14
Operating systems tested on:
Linux
Linked PRs
Bug report
Bug description:
I was working on adding support for the fancy new complex
ctypestypes tonumpy.ctypeslib1, but ran into the problem that thec_{float,double,longdouble}_complextypes do not have the__ctype_{be,le}__attributes that e.g. their non-complex counterparts have:I checked Python 3.14.4 and 3.15.0a8.
CPython versions tested on:
3.14
Operating systems tested on:
Linux
Linked PRs
__ctype_le/be__attributes for complex types in the ctype module #148485Footnotes
NumPy relies on these attributes when converting e.g.
numpy.dtype(">d")toctypes.c_double.__ctype_be__usingnumpy.ctypeslib.as_ctypes_type(docs). ↩