[Python-ideas] Fix some special cases in Fractions?

Jeroen Demeyer J.Demeyer at UGent.be
Thu Aug 30 01:55:26 EDT 2018


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.

I consider it a feature to know in advance the type of the output of an 
operation, given the types of the input. Having an unexpected type 
suddenly show up because you happen to hit a special case is a recipe 
for bugs.


Jeroen.


More information about the Python-ideas mailing list