FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-121249: Support _Complex types in the struct module by skirpichev · Pull Request #121613 · python/cpython · GitHub

/ cpython Public

gh-121249: Support _Complex types in the struct module - #121613

Merged
vstinner merged 12 commits into
python:mainfrom
skirpichev:complex-in-struct-module-121249
Oct 7, 2024
Merged

gh-121249: Support _Complex types in the struct module#121613
vstinner merged 12 commits into
python:mainfrom
skirpichev:complex-in-struct-module-121249

Conversation

skirpichev commented Jul 11, 2024
edited by github-actions Bot
Loading

Copy link
Copy Markdown
Member

ZeroIntensity 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nice PR! This looks like something that would have had to get approved on Discourse, though.

Comment thread Doc/library/struct.rst Outdated
Comment thread Doc/library/struct.rst
Comment thread Modules/_struct.c
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>

This comment was marked as outdated.

Copy link
Copy Markdown
Member

Lets leave this to core devs.

This is why things get discussed on discourse first 😉

Comment thread Doc/library/struct.rst Outdated
Comment thread Lib/test/test_struct.py Outdated

ZeroIntensity 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This implementation LGTM.

Although, for core dev review, I'm not too sure about this behavior: if the compiler does not support C11 complex types, then the new format characters are disabled and raise an error with no further information.

I'm worried that this will lead to some bug reports later on wondering why E and C don't work on their system -- it would be ideal to raise a different error mentioning that the system doesn't support C11 (albeit, it would be more work to implement).

picnixz left a comment
edited
Loading

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Some minor comments but I also agree that having an error without info for an unknown format if complex are not supported is a bit weird.

Comment thread Doc/library/struct.rst Outdated
Comment thread Doc/library/struct.rst Outdated
skirpichev force-pushed the complex-in-struct-module-121249 branch from 7806d52 to fec6be6 Compare July 13, 2024 04:12

Copy link
Copy Markdown
Member Author

Now on systems without _Complex type - a different error will be raised.

Comment thread Lib/test/test_struct.py Outdated

picnixz 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

On my side it's fine. I didn't check in details the functions bodies, but I assume that the tests should cover most of the cases. I think it remains to wait for Victor's and/or Serhiy's review.

Copy link
Copy Markdown
Member Author

As it's a follow up of #120894, CC @vstinner

Comment thread Lib/test/test_struct.py Outdated
Comment thread Lib/test/test_struct.py Outdated
Comment thread Modules/_struct.c Outdated
Comment thread Modules/_struct.c Outdated
Comment thread Modules/_struct.c Outdated
Comment thread Modules/_struct.c Outdated
Comment thread Modules/_struct.c Outdated
skirpichev requested a review from vstinner October 7, 2024 10:23

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

vstinner merged commit 7487db4 into python:main Oct 7, 2024

vstinner commented Oct 7, 2024

Copy link
Copy Markdown
Member

Merged, thanks.

skirpichev deleted the complex-in-struct-module-121249 branch October 7, 2024 11:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

4 participants


Back | FazBrowse Home | New Git URL