Skip to content

gh-121249: Deprecate using F/D type codes in the struct module#152309

Open
skirpichev wants to merge 6 commits into
python:mainfrom
skirpichev:deprecate-FD-codes/121249
Open

gh-121249: Deprecate using F/D type codes in the struct module#152309
skirpichev wants to merge 6 commits into
python:mainfrom
skirpichev:deprecate-FD-codes/121249

Conversation

@skirpichev

@skirpichev skirpichev commented Jun 26, 2026

Copy link
Copy Markdown
Member

@read-the-docs-community

read-the-docs-community Bot commented Jun 26, 2026

Copy link
Copy Markdown

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

IMO F/D formats soft deprecation should be removed from Doc/deprecations/soft-deprecations.rst, since the formats are now hard deprecated.

Comment thread Misc/NEWS.d/next/Library/2026-06-26-19-01-13.gh-issue-121249.p1SBW0.rst Outdated
Comment thread Doc/deprecations/pending-removal-in-3.21.rst Outdated
Comment thread Doc/whatsnew/3.16.rst Outdated
Comment thread Lib/test/test_struct.py Outdated
Comment thread Lib/test/test_struct.py Outdated
with self.subTest(format=f):
with warnings.catch_warnings():
warnings.simplefilter("error", DeprecationWarning)
self.assertRaises(DeprecationWarning, struct.pack, f, z)

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.

We already check with self.assertWarns(DeprecationWarning): below. I'm not sure that checking for DeprecationWarning exception is useful.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We do this in other places.

Comment thread Lib/test/test_struct.py Outdated
Comment thread Doc/whatsnew/3.16.rst
skirpichev and others added 2 commits June 30, 2026 03:04
Co-authored-by: Victor Stinner <vstinner@python.org>
@skirpichev

Copy link
Copy Markdown
Member Author

IMO F/D formats soft deprecation should be removed from Doc/deprecations/soft-deprecations.rst, since the formats are now hard deprecated.

Sure, I completely forgot that file. Done, with other requested changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants