[Python-ideas] Fix some special cases in Fractions?
Neil Girdhar
mistersheik at gmail.com
Thu Aug 30 02:53:52 EDT 2018
On Thu, Aug 30, 2018 at 2:09 AM Greg Ewing <greg.ewing at canterbury.ac.nz>
wrote:
> Jeroen Demeyer wrote:
> > On 2018-08-30 06:39, Neil Girdhar wrote:
> >
> >> I'd like these to be Fraction(1), Fraction(1), and Fraction(0).
> >
> > Why? I cannot think of any natural use case why you would want Fractions
> > for a few special cases on an operation which returns non-Fractions
> > generically.
>
> Also, Fraction(1) for the second case would be flat-out wrong.
>
No, it's not "wrong". 1 is one of the cube roots of 1. It's consistent
with 1 ** (2/3) == 1.
--
> Greg
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "python-ideas" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/python-ideas/aZIHpPhe0mw/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> python-ideas+unsubscribe at googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180830/a4416ed0/attachment.html>
More information about the Python-ideas
mailing list