On Mon, Oct 1, 2018 at 9:36 AM Steven D'Aprano
Then we can add a keyword only argument to round:
round(number, ndigits=0, *, mode=ROUND_HALF_EVEN)
To use it, you can import the rounding mode you want from math:
from math import ROUND_CEILING round(x, 3, mode=ROUND_CEILING)
I have no problem with this.
and everyone is happy (he says optimistically).
And I am as dubious as you are about this :) IMO, the biggest problem with round() is that it's TOO discoverable. People reach for it when what they really should be using is string formatting ("I want to display all these values to three decimal places"), and then sometimes get bitten when something doesn't actually display the way they think it will. When it's used correctly, it's usually fine. ChrisA