[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

Serhiy Storchaka report at bugs.python.org
Thu Jul 28 02:03:36 EDT 2016


Serhiy Storchaka added the comment:

I agreed with Martin. The "host" byte order is sys.byteorder, and the "net" byteorder is just "big". There is one obvious way to specify this, and there is not need to add yet one way.

Adding support of new values for byteorder would complicate and slow down the code. int.to_bytes() and int.from_bytes() already are slower then struct.pack() and struct.unpack(), and parsing the byteorder argument is the main culprit here (see also issue27574).

I'm for rejecting this idea.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27638>
_______________________________________


More information about the Python-bugs-list mailing list