Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-146238: add missing tests for 'e', 'Zf' and 'Zd' array type codes in test_buffer.py#149345

Merged
vstinner merged 9 commits into
python:mainpython/cpython:mainfrom
skirpichev:amend-e-formatskirpichev/cpython:amend-e-formatCopy head branch name to clipboard
May 6, 2026
Merged

gh-146238: add missing tests for 'e', 'Zf' and 'Zd' array type codes in test_buffer.py#149345
vstinner merged 9 commits into
python:mainpython/cpython:mainfrom
skirpichev:amend-e-formatskirpichev/cpython:amend-e-formatCopy head branch name to clipboard

Conversation

@skirpichev

@skirpichev skirpichev commented May 4, 2026

Copy link
Copy Markdown
Member

This amends e79fd60.  I'll not fix this for 'F'/'D' complex types as
they might be removed.
@bedevere-app bedevere-app Bot added the tests Tests in the Lib/test dir label May 4, 2026
@skirpichev skirpichev closed this May 4, 2026
@skirpichev skirpichev deleted the amend-e-format branch May 4, 2026 15:25
@skirpichev skirpichev restored the amend-e-format branch May 5, 2026 02:01
@skirpichev skirpichev reopened this May 5, 2026
@skirpichev skirpichev changed the title gh-146238: add missing tests for 'e' type code in test_buffer.py gh-146238: add missing tests for 'e', 'Zf' and 'Zd' array type codes in test_buffer.py May 5, 2026
@skirpichev skirpichev requested a review from vstinner May 5, 2026 02:27
@skirpichev

Copy link
Copy Markdown
Member Author

CC @vstinner

@skirpichev

This comment was marked as resolved.

@read-the-docs-community

This comment was marked as spam.

Comment thread Lib/test/test_buffer.py Outdated
Comment thread Lib/test/test_buffer.py Outdated
Comment thread Lib/test/test_buffer.py
@vstinner

This comment was marked as resolved.

@vstinner

vstinner commented May 5, 2026

Copy link
Copy Markdown
Member

On WASI, ALIGNOF_MAX_ALIGN_T is 16 bytes and struct.calcsize("Zd") is 16 bytes. WASI is a 32-bit platform (sys.maxsize is 2147483647). Maybe we should only test formats up to 4 bytes?

Would it make sense to use MAX_ALIGN = struct.calcsize('P')?

@skirpichev

Copy link
Copy Markdown
Member Author

Would it make sense to use MAX_ALIGN = struct.calcsize('P')?

As you see from the commit history, just removing the 'Zd' type - works. But I would like to use a more generic solution.

@vstinner vstinner merged commit ffa4d47 into python:main May 6, 2026
49 checks passed
@vstinner

vstinner commented May 6, 2026

Copy link
Copy Markdown
Member

I prefer a small performance hit for readability.

I would prefer to not build list("bBhHiIlLefd") + ['Zf', 'Zd'] list at each NATIVE iteration, but it's not a big deal. I merged your PR. Thanks for additional tests.

@skirpichev skirpichev deleted the amend-e-format branch May 6, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.