KEMBAR78
gh-119740: Remove deprecated trunc delegation by mdickinson · Pull Request #119743 · python/cpython · GitHub
Skip to content

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>
Sign up for free to 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