Skip to content

gh-145633: deprecate float.__getformat__() class method#146400

Open
skirpichev wants to merge 4 commits intopython:mainfrom
skirpichev:deprecate-__getformat__/145633
Open

gh-145633: deprecate float.__getformat__() class method#146400
skirpichev wants to merge 4 commits intopython:mainfrom
skirpichev:deprecate-__getformat__/145633

Conversation

@skirpichev
Copy link
Member

@skirpichev skirpichev commented Mar 25, 2026

(Contributed by Hugo van Kemenade and Stan Ulbrych in :gh:`76007`.)

* The ``__getformat__()`` class method of the :class:`float` is deprecated
and will be removed in Python 3.20.
Copy link
Member

Choose a reason for hiding this comment

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

You should document the deprecation in What's New in Python 3.15.

What is the migration path for projects currently relying on __getformat__()? Do they have to copy/paste the big _have_ieee_doubles() function?

Copy link
Member Author

Choose a reason for hiding this comment

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

What is the migration path for projects currently relying on getformat()? Do they have to copy/paste the big _have_ieee_doubles() function?

Primary goal is using the CPython's test suite. No changes needed.

But for the rest - yes.

@skirpichev skirpichev requested a review from AA-Turner as a code owner March 25, 2026 07:09
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