diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2010-06-17 18:24:52 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2010-06-17 18:24:52 (GMT) |
commit | f4112e2653f310b6e6a210c659648dbe45d3a042 (patch) | |
tree | e04fd72539a6b8d117d204f91d1b9939b4ce8ddc | |
parent | 684760a148b6fd580f40914e84ec5f023b84378e (diff) | |
download | cpython-f4112e2653f310b6e6a210c659648dbe45d3a042.zip cpython-f4112e2653f310b6e6a210c659648dbe45d3a042.tar.gz cpython-f4112e2653f310b6e6a210c659648dbe45d3a042.tar.bz2 |
Add note about changes to the `round` function between 2.x and 3.x.
-rw-r--r-- | Doc/whatsnew/3.0.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.0.rst b/Doc/whatsnew/3.0.rst index c748993..afec5fc 100644 --- a/Doc/whatsnew/3.0.rst +++ b/Doc/whatsnew/3.0.rst @@ -798,6 +798,15 @@ Builtins * A new built-in function :func:`next` was added to call the :meth:`__next__` method on an object. +* The :func:`round` function rounding strategy and return type have + changed. Exact halfway cases are now rounded to the nearest even + result instead of away from zero. (For example, ``round(2.5)`` now + returns ``2`` rather than ``3``.) :func:`round(x[, n])` now + delegates to ``x.__round__([n])`` instead of always returning a + float. It generally returns an integer when called with a single + argument and a value of the same type as ``x`` when called with two + arguments. + * Moved :func:`intern` to :func:`sys.intern`. * Removed: :func:`apply`. Instead of ``apply(f, args)`` use |