Skip to content

gh-119740: Remove deprecated trunc delegation#119743

Merged
mdickinson merged 18 commits intopython:mainfrom
mdickinson:remove-deprecated-trunc-delegation
Jun 2, 2024
Merged

gh-119740: Remove deprecated trunc delegation#119743
mdickinson merged 18 commits intopython:mainfrom
mdickinson:remove-deprecated-trunc-delegation

Conversation

@mdickinson
Copy link
Member

@mdickinson mdickinson commented May 29, 2024

This PR removes the delegation of int to the __trunc__ special method: int will now only delegate to __int__ and __index__ (in that order). __trunc__ continues to exist, but its sole purpose is to support math.trunc.


📚 Documentation preview 📚: https://cpython-previews--119743.org.readthedocs.build/

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

LGTM. But I would prefer to merge this after #119687, to make backporting of #119687 easier.

@mdickinson
Copy link
Member Author

Thanks for the comments; I'll address before merging (but it may take me a few days to get to it).

@mdickinson
Copy link
Member Author

But I would prefer to merge this after #119687, to make backporting of #119687 easier.

Definitely! Looks like #119687 has gone in now; I'll update for conflicts when I get the chance.

mdickinson and others added 2 commits June 2, 2024 09:34
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
mdickinson and others added 2 commits June 2, 2024 09:37
@mdickinson
Copy link
Member Author

Updating for merge conflicts ...

@mdickinson mdickinson merged commit f79ffc8 into python:main Jun 2, 2024
barneygale pushed a commit to barneygale/cpython that referenced this pull request Jun 5, 2024
Remove the delegation of `int` to the `__trunc__` special method: `int` will now only delegate to `__int__` and `__index__` (in that order). `__trunc__` continues to exist, but its sole purpose is to support `math.trunc`.

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
Remove the delegation of `int` to the `__trunc__` special method: `int` will now only delegate to `__int__` and `__index__` (in that order). `__trunc__` continues to exist, but its sole purpose is to support `math.trunc`.

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
Remove the delegation of `int` to the `__trunc__` special method: `int` will now only delegate to `__int__` and `__index__` (in that order). `__trunc__` continues to exist, but its sole purpose is to support `math.trunc`.

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
skirpichev added a commit to skirpichev/cpython that referenced this pull request Feb 9, 2026
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 9, 2026
…on (pythonGH-144622)

This was done in pythonGH-119743 (3.14).
(cherry picked from commit aa6ed80)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
serhiy-storchaka pushed a commit that referenced this pull request Feb 9, 2026
…ion (GH-144622) (GH-144624)

This was done in GH-119743 (3.14).
(cherry picked from commit aa6ed80)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
thunder-coding pushed a commit to thunder-coding/cpython that referenced this pull request Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants