[docs] [issue14783] Make int() and str() docstrings correct
Serhiy Storchaka
report at bugs.python.org
Wed Sep 19 09:47:26 CEST 2012
Serhiy Storchaka added the comment:
> +.. function:: int(number=0)
First argument is named "x".
>>> int(number=42)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'number' is an invalid keyword argument for this function
>>> int(x=42)
42
+ int(string, base=10)
Here can be not only string, but bytes or bytearray.
>>> int('42', 6)
26
>>> int(b'42', 6)
26
>>> int(bytearray(b'42'), 6)
26
----------
nosy: +storchaka
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14783>
_______________________________________
More information about the docs
mailing list