On Mon, May 17, 2021 at 5:39 PM Shreyan Avigyan <pythonshreya...@gmail.com> wrote: > > I'm -1 on this change. Don't get me wrong I'd love having this change in > Python. *But* we use float not decimal.Decimal right? Why not? Because of > memory and precisions.
That argument only takes you so far. For instance, Python uses bignum integers even though most programs would be fine with 32-bit signed ints, because it's better to be correct than to save memory. > Decimal takes more memory than float and also 0.33333333333333 (float) is > accurate and very easy to deal with rather than > 0.33333333121211211200134333434343 (Decimal). Not sure I understand your point here. Generally, a Decimal is more accurate to what a human expects, because a float has to be representable in binary, but converting a Decimal into decimal digits is lossless. > I believe the same reason applies to fractions.Fraction. It's available to > users if they don't want to lose precision. But including it as a built-in I > don't think is a good idea. And it will also be a > "non-pep-reading-users-concerning-change" or simply "beginners concerning > change" since all previous versions of Python displayed floats and now it's > displaying Fractions! Some code may be hoping to find type() == float and to > it's surprise it's not that! > I agree that the division operator should not change. But none of the rest of your statement is an argument against Fraction literals. ChrisA _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/SVYSMEASZZCK4FGTYB32OHQFN54IMHGL/ Code of Conduct: http://python.org/psf/codeofconduct/