[Python-ideas] Backward-incompatible changes for Python 4

Dan Sommers 2QdxY4RzWzUUiLuE at potatochowder.com
Mon Apr 1 10:41:40 EDT 2019


On 4/1/19 10:27 AM, Antoine Pietri wrote:

> - The / operator returns floats, which loses information when both of
> the operands are integer. In Python 4, “1 / 2” should return a
> decimal.Decimal. To ease the transition, we propose to add a new “from
> __future__ import decimal_division” in Python 3.9 to enable this
> behavior.

“1 / 2” should be a syntax error.

"1 / 2" should return a string.

1 / 2 should return a fractions.Fraction.


More information about the Python-ideas mailing list