[issue30940] Documentation for round() is incorrect.

Mark Dickinson report at bugs.python.org
Thu Jul 27 13:08:47 EDT 2017


Mark Dickinson added the comment:

[Serhiy]
> is it worth to mention explicitly that round(number) and round(number, None) > delegate to number.__round__()?

Yes, if we can find a non-clunky wording that does that. The current wording does seem to misleadingly suggest that the delegation to `__round__` only happens for the two-argument version of round.

How about just:

> For a general Python object ``number``, ``round`` delegates to
> ``number.__round__``.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30940>
_______________________________________


More information about the Python-bugs-list mailing list