On Mon, Oct 1, 2018 at 9:36 AM Steven D'Aprano <steve at pearwood.info> wrote: > 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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4