[issue44866] Inconsistent Behavior of int()

Serhiy Storchaka report at bugs.python.org
Sun Aug 8 15:31:10 EDT 2021


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

I understand your confusion John.

The fact is that int() serves two functions. If argument is a number, it truncates it to an integer. If argument is a string, it parses the string representation of integer (not necessary decimal).

For details see https://docs.python.org/3/library/functions.html#int .

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44866>
_______________________________________


More information about the Python-bugs-list mailing list