You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
__ctype_{be,le}__ attributes missing for ctypes.c_*_complex types #148464
I was working on adding support for the fancy new complex ctypes types to numpy.ctypeslib1, 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__'
Activity
skirpichev commentedon Apr 13, 2026
Note, that these attributes are not available on
c_longdoubleas well. I don't see how we can change this.pythongh-148464: Add missing ``__ctype_le/be__`` attributes for compl…
pythongh-148464: Add missing ``__ctype_le/be__`` attributes for compl…
jorenham commentedon Apr 13, 2026
Eh,
long doublesucks anyway 😛. I'm already happy that you're able to fix the complexfloatanddoublecases.gh-148464: Add missing ``__ctype_le/be__`` attributes for complex typ…
pythongh-148464: Add missing ``__ctype_le/be__`` attributes for compl…
vstinner commentedon Apr 17, 2026
@skirpichev:
I'm curious. Is it because Python doesn't provide PyFloat_Pack8()/PyFloat_Unpack8() functions for
long double?skirpichev commentedon Apr 17, 2026
Yes, as there is not definite format for long doubles.
[3.14] gh-148464: Add missing ``__ctype_le/be__`` attributes for comp…
jorenham commentedon Apr 23, 2026
Thanks all
pythongh-148464: Add missing ``__ctype_le/be__`` attributes for compl…