Petr Viktorin <encu...@gmail.com> added the comment:

> So I vote for not handling incorrectly packed values and removing
"and any non-zero value will be True when unpacking" from the docs,
which does not seem to make any sense for _Bool.

I disagree. I don't think struct module's job is to be faithful to _Bool 
semantics.

Up to this point, "?" worked for bytes with "only 0 is false" semantics, in a 
reliable and documented way. I don't see a reason to let that continue.

You're right about trap representations, but IMO floats are much more tied to 
hardware (and serious users of float are aware of the pitfalls), while _Bool 
semantics are governed by the whims of the compiler.

Also, the "@" prefix is specifically documented to select native Byte order, 
Size, and Alignment; not how the bit-pattern is interpreted.

----------

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

Reply via email to