Mark Dickinson added the comment:

For native struct packing / unpacking, it's not even clear to me that this 
should be considered a bug (though for standard unpacking it definitely is):  
the primary use-case for native unpacking is unpacking a collection of bytes 
that was written (from Python, or C, or ...) on the same machine, and in that 
case we're only going to be unpacking 0s and 1s.

FWIW, the docs say: "Either 0 or 1 in the native or standard bool 
representation will be packed, and any non-zero value will be True when 
unpacking.", so for native packing either the docs or the code need to be fixed.

The simplest solution would be to replace `nu_bool` with something identical to 
`bu_bool`.  In theory that would break on any platform where "sizeof(_Bool)" is 
greater than 1.  In practice, I doubt that Python's going to meet such 
platforms in a hurry.

----------

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

Reply via email to