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-12.15:10:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1584025804.82.0.519439657943.issue39689@roundup.psfhosted.org>
In-reply-to
Content
The docs for native mode (we now always assume C99):

"The '?' conversion code corresponds to the _Bool type defined by C99."


The memoryview tests that fail are essentially auto-generated and not
prescriptive. They just happened to work without UBSan:


>>> x = array.array("B", [0,1,2,3])
>>> m = memoryview(x)
>>> m.format
'B'
>>> c = m.cast("?") # Wrong!
>>> c.tolist()
[False, True, True, True]


I don't see the point in working around UB for the purposes of
displaying the wrong cast.

If you do subsequent array operations with the variable "c", UB will happen there.



In theory you can do the same with a cast from unsigned to signed
integers. Signed integers are allowed to be trap representations,
though I don't know an actual platform where this is the case.
History
Date User Action Args
2020-03-12 15:10:04skrahsetrecipients: + skrah, gregory.p.smith, mark.dickinson, vstinner, benjamin.peterson, petr.viktorin, meador.inge, cstratak, ammar2
2020-03-12 15:10:04skrahsetmessageid: <1584025804.82.0.519439657943.issue39689@roundup.psfhosted.org>
2020-03-12 15:10:04skrahlinkissue39689 messages
2020-03-12 15:10:04skrahcreate