Josh Rosenberg <shadowranger+pyt...@gmail.com> added the comment:

to_bytes and from_bytes aren't remotely related to native primitive types, 
struct is. If the associated lengths aren't 2, 4 or 8, there is no real 
correlation with system level primitives, and providing these defaults makes it 
easy to accidentally write non-portable code.

Providing a default might make sense, but if you do, it should be a fixed 
default (so output is portable). Making it depend on the system byte order for 
no real reason aside from "so I can do struct-like things faster in a 
non-struct way" is not a valid reason to make a behavior both implicit and 
inconsistent.

----------
nosy: +josh.r

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34889>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to