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
- gh-148464: Add missing
__ctype_le/be__attributes for complex types in the ctype module #148485 - [3.14] gh-148464: Add missing
__ctype_le/be__attributes for complex types in the ctype module (GH-148485) #148677