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 Dominik V.
Recipients Dominik V., docs@python
Date 2020-04-20.19:37:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1587411465.5.0.0585658579804.issue40340@roundup.psfhosted.org>
In-reply-to
Content
The paragraph about [How do I convert a string to a number?](https://docs.python.org/3/faq/programming.html#how-do-i-convert-a-string-to-a-number) contains the following sentence:

> By default, these interpret the number as decimal, so that `int('0144') == 144` and `int('0x144')` raises ValueError.

The first part however doesn't raise an error. Most likely octal notation was meant, i.e. `int('0o144') == 144`.

For consistency with the `int('0x144')` part one could also omit the equality comparison, i.e. just write `int('0o144')`.

In order to emphasize that the "and" is not part of the code (though this should be displayed by the browser) once could also write:

> [...] so that _both_ `int('0o144')` and `int('0x144')` raise ValueError.

(emphasis added)
History
Date User Action Args
2020-04-20 19:37:45Dominik V.setrecipients: + Dominik V., docs@python
2020-04-20 19:37:45Dominik V.setmessageid: <1587411465.5.0.0585658579804.issue40340@roundup.psfhosted.org>
2020-04-20 19:37:45Dominik V.linkissue40340 messages
2020-04-20 19:37:45Dominik V.create