New submission from Марк Коренберг:
Docstring says:
The signed keyword-only argument determines whether two's complement is
used to represent the integer. If signed is False and a negative integer
is given, an OverflowError is raised.
But actually,
(130).to_bytes(1, 'big', signed=True)
will also trigger OverflowError
----------
assignee: docs@python
components: Documentation, Library (Lib)
messages: 271327
nosy: docs@python, mmarkk
priority: normal
severity: normal
status: open
title: int.to_bytes(): docstring is not precise
type: enhancement
versions: Python 3.6
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue27622>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com