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 JBernardo
Recipients JBernardo, docs@python
Date 2013-12-09.04:24:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
From the docs for built-in function "round":
   "If ndigits is omitted, it defaults to zero"

But, the only way to get an integer from `round` is by not having the second argument (ndigits):

    >>> round(3.5)
    >>> round(3.5, 1)
    >>> round(3.5, 0)
    >>> round(3.5, -1)
    >>> round(3.5, None)
    Traceback (most recent call last):
      File "<pyshell#6>", line 1, in <module>
        round(3.5, None)
    TypeError: 'NoneType' object cannot be interpreted as an integer

Either the docs are wrong or the behavior is wrong. I think it's easier to fix the former...

But also there should be a way to make round return an integer (e.g. passing `None` as 2nd argument)
Date User Action Args
2013-12-09 04:24:20JBernardosetrecipients: + JBernardo, docs@python
2013-12-09 04:24:20JBernardosetmessageid: <>
2013-12-09 04:24:20JBernardolinkissue19933 messages
2013-12-09 04:24:19JBernardocreate