[issue36048] Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__

Calin Culianu report at bugs.python.org
Thu Dec 9 12:05:26 EST 2021


Calin Culianu <calin.culianu at gmail.com> added the comment:

Hi, I'm cculianu, the reporting user.

May I get a link or some background for the motivation for this change? It seems to me that there are vague allusions to "Decimal -> int cause problems in past", or some such, and I'd like to read the arguments presented as to what problems in particular, and how this change fixes those problems.

Mathematically, and by convention in computer science, conversions from float-like types -> int are always well defined.  It seems strangely un-Pythonic to restrict things in such a way.  I am very surprised by this change, quite frankly.  It's the wrong direction to go in, for this language, is my intuitive feeling.

Anyway, very curious about what the rationale was for this. Thanks.

----------
nosy: +calin.culianu

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


More information about the Python-bugs-list mailing list