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 jab
Recipients MJH, ezio.melotti, jab, jyasskin, mark.dickinson, serhiy.storchaka
Date 2018-09-26.11:09:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1537960170.25.0.545547206417.issue32956@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks Serhiy, I read the Python-Dev thread you linked to, but that doesn't resolve the issues:

- Its topic is Python 2.6 (where this behavior does not occur) rather than Python 3 (where it does).

- A few messages into the thread Guido does address Python 3, but in fact says "I think the consensus is against round-to-even in 3.0" (see https://mail.python.org/pipermail/python-dev/2008-January/075897.html).

- There is no discussion of the fact that this behavior differs from the function named "round" in all the other programming languages I mentioned, and whether it would therefore be better exposed as an additional function (e.g. "round_to_even" or "round_unbiased", and in the math or statistics package rather than builtins). Surprisingly, Excel is the only other programming environment I saw discussed in the thread. (And round(2.5) == 3 there.)

So that all suggests there must be some other thread or issue where this change for Python 3 have been discussed, but I looked again and could not find it. 

The C "rint" example you gave just seems to prove the point that this behavior should have a distinct name from "round".

Regarding:
> It is a common knowledge that rounding half-to-even is what users want in most cases

I don't think that's common knowledge; seems like citation needed? Based on all the other languages where this differs (not to mention Python 2), it's not clear users would want Python 3 to be the only different one. And this is definitely a surprise for the majority of programmers, whose experience with "round" is how it works everywhere else. (This is making it into pywat after all: https://github.com/cosmologicon/pywat/pull/40)

I can submit a PR for at least updating the docs about this (as per my previous comment) if that would be welcomed.
History
Date User Action Args
2018-09-26 11:09:30jabsetrecipients: + jab, mark.dickinson, jyasskin, ezio.melotti, serhiy.storchaka, MJH
2018-09-26 11:09:30jabsetmessageid: <1537960170.25.0.545547206417.issue32956@psf.upfronthosting.co.za>
2018-09-26 11:09:30jablinkissue32956 messages
2018-09-26 11:09:30jabcreate