New submission from Chris Wilson :
The documentation for the int() builtin says:
Base 0 means to interpret exactly as a code literal, so that the actual base is
2, 8, 10, or 16, and so that int('010', 0) is not legal, while int('010') is,
as well as int('010', 8).
https://docs.python.org/3/library/functions.html#int
However 010 is a valid code literal, and int('010', 0) is legal (both are
correctly interpreted as octal).
--
assignee: docs@python
components: Documentation
messages: 389145
nosy: docs@python, wilscm
priority: normal
severity: normal
status: open
title: Docs say int('010', 0) is not legal, but it is
versions: Python 3.10
___
Python tracker
<https://bugs.python.org/issue43566>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com