This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients belopolsky, facundobatista, mark.dickinson, rhettinger, serhiy.storchaka, skrah, stutzbach, wolma
Date 2017-11-08.13:56:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1510149407.79.0.213398074469.issue31978@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2017-11-08 13:56:47mark.dickinsonsetrecipients: + mark.dickinson, rhettinger, facundobatista, belopolsky, stutzbach, skrah, serhiy.storchaka, wolma
2017-11-08 13:56:47mark.dickinsonsetmessageid: <1510149407.79.0.213398074469.issue31978@psf.upfronthosting.co.za>
2017-11-08 13:56:47mark.dickinsonlinkissue31978 messages
2017-11-08 13:56:47mark.dickinsoncreate