Skip to content

gh-119740: Remove deprecated trunc delegation - #119743

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

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

Conversation

@mdickinson

@mdickinsonmdickinson commented May 29, 2024

Copy link
Copy Markdown
Member

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/

Comment threadDoc/library/functions.rst Outdated
Comment threadDoc/reference/datamodel.rst Outdated
Comment threadDoc/library/functions.rst Outdated
Comment threadDoc/whatsnew/3.14.rst Outdated

@serhiy-storchakaserhiy-storchaka 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.

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

Comment threadDoc/whatsnew/3.14.rst Outdated
Comment threadDoc/library/functions.rst Outdated
Comment threadDoc/whatsnew/3.14.rst Outdated
Comment threadDoc/library/functions.rst Outdated
@mdickinson

Copy link
Copy Markdown
MemberAuthor

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

@mdickinson

Copy link
Copy Markdown
MemberAuthor

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.

mdickinsonand 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>
Comment threadDoc/whatsnew/3.14.rst Outdated
mdickinsonand others added 2 commits June 2, 2024 09:37
Comment threadDoc/reference/datamodel.rst Outdated
@mdickinson

Copy link
Copy Markdown
MemberAuthor

Updating for merge conflicts ...

@mdickinson
mdickinson merged commit f79ffc8 into python:mainJun 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
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@mdickinson@serhiy-storchaka@picnixz