Skip to content

Conversation

@skirpichev
Copy link
Member

@skirpichevskirpichev commented May 1, 2025

  • drop _complex.h header
  • use appropriate real arrays to replace complex types

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

Note, that Py_FFI_SUPPORT_C_COMPLEX check configure check imply support for complex types. So, Py_HAVE_C_COMPLEX check is redundant. Though, I'm not sure if it worth removing.

…struct module Each complex type interpreted as an array type containing exactly two elements of the corresponding real type (real and imaginary parts, respectively).
@skirpichev
Copy link
MemberAuthor

This is on top of #132864

CC @dalcinl

…ctypes * drop _complex.h header * use appropriate real arrays to replace complex types
@skirpichevskirpichevforce-pushed the no_complex.h/61103 branch from efbe0bb to 6a20fafCompareMay 1, 2025 04:32
@skirpichevskirpichev marked this pull request as ready for review May 1, 2025 05:17
@skirpichevskirpichev changed the title gh-61103: don't use native complex types to implement F/D/G in ctypesgh-61103: don't use native complex types in ctypesMay 1, 2025
@dalcinl
Copy link
Contributor

dalcinl commented May 1, 2025

@skirpichev Thanks, it looks great. IMHO, and despite your doubts about worthiness, this should be merged. Things are simpler now, you removed lots of code, and a private header.

Minor nit: I think the complex types logic that got added to configure.ac can be safely removed.Needed for ctypes tests.

Co-authored-by: Lisandro Dalcin <dalcinl@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
@skirpichevskirpichev requested review from dalcinl and encukouMay 1, 2025 13:39
…ue2nK.rst Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
@encukouencukou added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label May 2, 2025
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @encukou for commit 071d57e 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F133237%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label May 2, 2025
Copy link
Member

@encukouencukou left a comment

Choose a reason for hiding this comment

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

LGTM, merge if the buildbots don't complain.

@skirpichev
Copy link
MemberAuthor

@encukou, this pr was on top of #132864, which already tested with buildbots. If we are going to merge this, I would prefer to do it via two separate commits.

@encukou
Copy link
Member

Ah, I missed that note, sorry!
Could you add the latest wording changes there?

@skirpichev
Copy link
MemberAuthor

Could you add the latest wording changes there?

Done. See also minor docs correction in #133249

@skirpichev
Copy link
MemberAuthor

Failure in test_frame.py on s390x seems unrelated.

@skirpichev
Copy link
MemberAuthor

All failures are related to test_frame.py.

@encukou, I left here only one change, related to the struct module (cosmetic change in _Alignof operands), as it was related to code. I hope it's ok.

@skirpichev
Copy link
MemberAuthor

@dalcinl, let us know if you think that linked issue should stay open after merging this.

@dalcinl
Copy link
Contributor

@skirpichev I think you can close it. AFAICT, all concerns have been addressed. Many thanks for your hard work in implementing all these changes.

Copy link
Member

@encukouencukou left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@encukouencukou merged commit 8d0e07e into python:mainMay 5, 2025
45 checks passed
@skirpichevskirpichev deleted the no_complex.h/61103 branch May 5, 2025 09:42
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
…es (pythonGH-133237) According to the C standard, the memory representation of _Complex types is equivalent to 2-element arrays. Unlike _Complex, arrays are always available. - drop _complex.h header - use appropriate real arrays to replace complex types Co-authored-by: Lisandro Dalcin <dalcinl@gmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@skirpichev@dalcinl@bedevere-bot@encukou@StanFromIreland@DangNhutNguyen