Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 7 commits into from
Jul 3, 2024

Conversation

skirpichev
Copy link
Member

@skirpichev skirpichev commented Jul 2, 2024

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
Contributor

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

Lib/test/test_ctypes/test_libc.py Show resolved Hide resolved
Lib/test/test_ctypes/test_libc.py Show resolved Hide resolved
Lib/test/test_ctypes/test_numbers.py Show resolved Hide resolved
Lib/test/test_ctypes/test_numbers.py Outdated Show resolved Hide resolved
Modules/_complex.h Show resolved Hide resolved
Modules/_complex.h Show resolved Hide resolved
Modules/_ctypes/_ctypes_test.c Show resolved Hide resolved
Modules/_ctypes/_ctypes_test.c Show resolved Hide resolved
Copy link
Member

@vstinner vstinner left a comment

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
38 checks passed
@skirpichev skirpichev deleted the ctypes-floatlong-complex-61103 branch July 3, 2024 09:23
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 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]>
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