Mark Dickinson <dicki...@gmail.com> added the comment:

> There is one slight additional tweak in the patch: in the case of ndigits < 
> 0, it returns an int, not a Fraction (see test_fractions modification to make 
> it pass).

This would be a backwards incompatible change, potentially breaking existing 
code, so we'd need to think carefully before making it. It's definitely not a 
"slight tweak" :-).

I'd prefer that this change is not made at all: in general, it's not a great 
idea to have a return _type_ that changes depending on the _values_ of an 
argument (though as always, there are exceptions). The general rule is that 
two-argument `round` returns something of the same type as its first argument: 
I don't think there's a really compelling reason to change this for the 
Fraction type. So -1 on this change from me.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31978>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to