[issue44547] fraction.Fraction does not implement __int__.

Serhiy Storchaka report at bugs.python.org
Fri Jul 2 16:33:50 EDT 2021


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

In ideal world we would use __int__ for (1), and __trunc__ for (2). But for some historical reasons __index__ was introduced for (1) and __int__ is only used in the int constructor, although it falls back to __trunc__.

I am wondering whether one of __int__ or __trunc__ should be deprecated.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44547>
_______________________________________


More information about the Python-bugs-list mailing list