This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Weihong Guan
Recipients Weihong Guan
Date 2016-10-06.13:14:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1475759663.29.0.378814371853.issue28377@psf.upfronthosting.co.za>
In-reply-to
Content
According to the doc:

For the '?' format character, the return value is either True or False. When packing, the truth value of the argument object is used. Either 0 or 1 in the native or standard bool representation will be packed, and any non-zero value will be True when unpacking.

But it behaves more like & 1 operation. so False for even value, and True for odd value.

unpack fmt '?H' should reqiure buff of length 3, same as 'H?', not 4.
History
Date User Action Args
2016-10-06 13:14:23Weihong Guansetrecipients: + Weihong Guan
2016-10-06 13:14:23Weihong Guansetmessageid: <1475759663.29.0.378814371853.issue28377@psf.upfronthosting.co.za>
2016-10-06 13:14:23Weihong Guanlinkissue28377 messages
2016-10-06 13:14:22Weihong Guancreate