gh-148464: Add missing ``__ctype_le/be__`` attributes for complex types in the ctype module by skirpichev · Pull Request #148485 · python/cpython

@skirpichev

…ex types in the ctype module

eendebakpt

@skirpichev

eendebakpt

encukou

Old code relying on implementation detail, that elements[1] for
the FFI_TYPE_COMPLEX was never read.

But this type actually shares same assumption as the FFI_TYPE_STRUCT:
the elements field is a NULL-terminated array of pointers to ffi_type
objects.  So far for primitive types - only complex types have this
struct field as non-NULL (two element array).

@skirpichev

@skirpichev

sunmy2019

@skirpichev @sunmy2019

Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>