Skip to content

gh-61103: Support float and long double complex types in ctypes module - #121248

Merged
vstinner merged 7 commits into
python:mainfrom
skirpichev:ctypes-floatlong-complex-61103
Jul 3, 2024
Merged

vstinner merged 7 commits into
python:mainfrom
skirpichev:ctypes-floatlong-complex-61103

Conversation

@skirpichev

@skirpichev skirpichev commented Jul 2, 2024 •

Copy link
Copy Markdown
Member

This amends 6988ff0: memory allocation for stginfo->ffi_type_pointer.elements in PyCSimpleType_init() should be more generic (perhaps someday fmt->pffi_type->elements will be not a two-elements array).

It should finally resolve #61103.


📚 Documentation preview 📚: https://cpython-previews--121248.org.readthedocs.build/

… module

This amends 6988ff0: memory allocation for
stginfo->ffi_type_pointer.elements in PyCSimpleType_init() should be
more generic (perhaps someday fmt->pffi_type->elements will be not a
two-elements array).

It should finally resolve python#61103.
@nineteendo

Copy link
Copy Markdown
Contributor

Looking good, if merged this would fix the table of complex types only having a single row.

Comment thread Lib/test/test_ctypes/test_libc.py Resolved
Comment thread Lib/test/test_ctypes/test_libc.py Resolved
Comment thread Lib/test/test_ctypes/test_numbers.py Resolved
Comment thread Lib/test/test_ctypes/test_numbers.py Resolved
Comment thread Modules/_complex.h Resolved
Comment thread Modules/_complex.h Resolved
Comment thread Modules/_ctypes/_ctypes_test.c Resolved
Comment thread Modules/_ctypes/_ctypes_test.c Resolved
Comment thread Lib/test/test_ctypes/test_numbers.py Resolved
Comment thread Doc/library/ctypes.rst Resolved

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vstinner
vstinner merged commit 51c4a32 into python:main Jul 3, 2024
@skirpichev
skirpichev deleted the ctypes-floatlong-complex-61103 branch July 3, 2024 09:23
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
… module (python#121248)

This amends 6988ff0: memory allocation for
stginfo->ffi_type_pointer.elements in PyCSimpleType_init() should be
more generic (perhaps someday fmt->pffi_type->elements will be not a
two-elements array).

It should finally resolve python#61103.

Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants