What am I missing?
The integers between 0 and 255 map directly to a particular byte value.
But any other integer could be expressed as a wide variety of multiple byte combinations.
The proposal here covers byte-order, but what about 16 vs 32 vs 64 bits? Unsigned vs signed?
I thought that’s what the struct module is for.
There is the byte representation of Python’s bignum, but is that consistent across platforms and implementations?
(Micropytjon, PyPy, IronPython, Jython)
And even if so, is it useful?
NOTE: my objection to “bchr”, whether as a builtin or not is not the functionality, it’s the name. Equating a byte with a character is a legacy of C ( and Python 2” — in Python 3, they are completely distinct concepts. Yes, that is serious bike-shedding :-)
Christopher Barker, PhD (Chris)
Python Language Consulting
- Scientific Software Development
- Desktop GUI and Web Development
- wxPython, numpy, scipy, Cython