[Python-Dev] Sign of bytes (original) (raw)
Xavier Morel python-dev at masklinn.net
Wed Oct 31 19:19:07 CET 2012
- Previous message: [Python-Dev] Sign of bytes
- Next message: [Python-Dev] Sign of bytes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 2012-10-31, at 18:44 , anatoly techtonik wrote:
I wonder why Python uses signed chars for bytes http://docs.python.org/2/library/ctypes.html#ctypes.cbyte
That's not Python, that's ctypes. struct[0] has no "bytes" it uses "char" for everything.
If I had to guess, it would be because "char" is already an unsigned char in ctypes, "signed_char" is way too long, "schar" looks like dog vomit and there was no point in aliasing "byte" to "char. Which left "byte" free for "signed char".
[0] http://docs.python.org/2/library/struct.html#format-characters
- Previous message: [Python-Dev] Sign of bytes
- Next message: [Python-Dev] Sign of bytes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]