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 skrah
Recipients ammar2, benjamin.peterson, cstratak, gregory.p.smith, mark.dickinson, meador.inge, petr.viktorin, skrah, vstinner
Date 2020-03-11.22:42:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1583966538.28.0.334324859652.issue39689@roundup.psfhosted.org>
In-reply-to
Content
I checked that NumPy also packs correctly:

>>> import numpy as np
>>> x = np.array([0,1,2,3], dtype=np.bool)
>>> x.tobytes()
b'\x00\x01\x01\x01'

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.

memoryview also does not guard against the theoretical possibility
of incorrectly packed values being trap representations. Values need
to be packed correctly, or you get UB.
History
Date User Action Args
2020-03-11 22:42:18skrahsetrecipients: + skrah, gregory.p.smith, mark.dickinson, vstinner, benjamin.peterson, petr.viktorin, meador.inge, cstratak, ammar2
2020-03-11 22:42:18skrahsetmessageid: <1583966538.28.0.334324859652.issue39689@roundup.psfhosted.org>
2020-03-11 22:42:18skrahlinkissue39689 messages
2020-03-11 22:42:18skrahcreate