Message364008
> 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. |
|
Date |
User |
Action |
Args |
2020-03-12 10:30:20 | petr.viktorin | set | recipients:
+ petr.viktorin, gregory.p.smith, mark.dickinson, vstinner, benjamin.peterson, skrah, meador.inge, cstratak, ammar2 |
2020-03-12 10:30:20 | petr.viktorin | set | messageid: <1584009020.7.0.178345089769.issue39689@roundup.psfhosted.org> |
2020-03-12 10:30:20 | petr.viktorin | link | issue39689 messages |
2020-03-12 10:30:20 | petr.viktorin | create | |
|