Skip to content

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

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

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

Conversation

@skirpichev
Copy link
Copy Markdown
Member

@skirpichev skirpichev commented Mar 25, 2026

@skirpichev skirpichev requested a review from AA-Turner as a code owner March 25, 2026 07:09
@skirpichev skirpichev requested a review from vstinner March 27, 2026 02:03
@skirpichev
Copy link
Copy Markdown
Member Author

CC @serhiy-storchaka

Copy link
Copy Markdown
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM

@skirpichev
Copy link
Copy Markdown
Member Author

@vstinner, please don't merge. I would appreciate a second review.

@serhiy-storchaka
Copy link
Copy Markdown
Member

in general, I like removing private, unsystematic, undocumented methods which only serve internal debugging purpose. There some things in bytearray and set. But first we need to look at their history and ask authors who added them. Do they still need them? I think that special testing module would be better place for such things.

@skirpichev
Copy link
Copy Markdown
Member Author

But first we need to look at their history and ask authors who added them. Do they still need them?

The __getformat__() class method, together with removed __setformat__() was added by ba283e2. CC @mwhudson

I think that special testing module would be better place for such things.

This private API now is helpful only for alternative implementations, which run the CPython test suite. I don't see how a special testing module would help here.

See #145633 (comment) for some usage examples.

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.

3 participants