Author jyasskin
Recipients dingo, giampaolo.rodola, jyasskin, loewis, mark.dickinson
Date 2008-12-20.19:43:58
SpamBayes Score 1.21648e-08
Marked as misclassified No
Message-id <1229802241.36.0.256514989717.issue4707@psf.upfronthosting.co.za>
In-reply-to
Content
When PEP 3141 says something should be Real, that includes both int and
float as possibilities (since Real is a supertype of Integral), so it's
consistent with the PEP for round(int, int) to return an int, and I
agree with Mark that round(25, -1) ought to return an int. Making that
change would be slightly backwards-incompatible, but IIRC, int is
supposed to be usable everywhere float is, so there should be very few
programs it would break. So my vote's to change it, for 3.0.1 if possible.

The documentation is a little too strict on __round__ implementations by
requiring round(x, y) to return the same type as x, but I think it
should still encourage __round__ to return the same type.

And, uh, oops for writing those bugs. Is your guess for round(25.0,
-1)==30.0 that 25.0*(1/10.0) is slightly more than 2.5 on some systems?
History
Date User Action Args
2008-12-20 19:44:01jyasskinsetrecipients: + jyasskin, loewis, mark.dickinson, giampaolo.rodola, dingo
2008-12-20 19:44:01jyasskinsetmessageid: <1229802241.36.0.256514989717.issue4707@psf.upfronthosting.co.za>
2008-12-20 19:43:59jyasskinlinkissue4707 messages
2008-12-20 19:43:58jyasskincreate