Message321730
I guess I'll weigh in since I was pinged.
I agree with the approach in the patch. All the memoryview does is to use the format field verbatim from the underlying buffer, so if the format field is inaccurate then the only thing to do is to fix the object providing the buffer.
Since the format field is only there for interpretation of the data, and is not used to calculate of itemsizes or strides anywhere as far as I know, it's a fairly low-risk change.
However, the patch still leaves ctypes inaccurate for the case of unions. It should be fairly simple to modify the code to use a format of "B<size>" for unions, so that it at least matches the itemsize, even if the type information is lost.
(As an aside, let me point out that I did not actually write or advocate for the PEP; for some reason my name was added to it even though I all I did was to provide feedback.) |
|
Date |
User |
Action |
Args |
2018-07-16 10:30:42 | aerojockey | set | recipients:
+ aerojockey, teoliphant, amaury.forgeotdarc, belopolsky, meador.inge, Eric.Wieser |
2018-07-16 10:30:42 | aerojockey | set | messageid: <1531737042.74.0.56676864532.issue32780@psf.upfronthosting.co.za> |
2018-07-16 10:30:42 | aerojockey | link | issue32780 messages |
2018-07-16 10:30:42 | aerojockey | create | |
|