Skip to content

gh-121249: deprecate support for complex types in the struct module#149346

Closed
skirpichev wants to merge 1 commit intopython:mainfrom
skirpichev:struct-deprecate-complex
Closed

gh-121249: deprecate support for complex types in the struct module#149346
skirpichev wants to merge 1 commit intopython:mainfrom
skirpichev:struct-deprecate-complex

Conversation

@skirpichev
Copy link
Copy Markdown
Member

@skirpichev skirpichev commented May 4, 2026

@read-the-docs-community
Copy link
Copy Markdown

Comment thread Doc/library/struct.rst
.. versionchanged:: 3.14
Added support for the ``'F'`` and ``'D'`` formats.

.. deprecated-removed:: 3.15 3.17
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.

Any reason to rush this and not use the recommended five years?

https://peps.python.org/pep-0387/#making-incompatible-changes

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.

Yes, this was intentional.

I see some reasons:

  1. This was introduced recently, I don't expect much breakage.
  2. This is a minor feature.
  3. I hope, it might be addressed by new PEP, that modernize the struct module and/or finish incomplete proposals of the PEP 3118.
  4. If no PEP will come - probably it's not that important ;-)

As an alternative, we could consider part of the Victor's PR #148676: use Zf/Zd codes per default and add F/D as aliases, for backward compatibility. But IMO, PEP is better.

@serhiy-storchaka
Copy link
Copy Markdown
Member

What is the reason for deprecation? Also, why is it linked to an issue closed long time ago?

@skirpichev
Copy link
Copy Markdown
Member Author

What is the reason for deprecation?

It's an alternative to #148676, see python/steering-council#345 (comment)

There are 3 PRs:

Also, why is it linked to an issue closed long time ago?

Reopened, thanks.

@encukou
Copy link
Copy Markdown
Member

encukou commented May 4, 2026

I'm -1.

@hugovk any objections to deprecating in a later beta, rather than b1? That would mean we don't need to decide now.

@skirpichev skirpichev closed this May 4, 2026
@skirpichev skirpichev deleted the struct-deprecate-complex branch May 4, 2026 15:09
@skirpichev skirpichev restored the struct-deprecate-complex branch May 5, 2026 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

4 participants