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 aerojockey
Recipients Eric.Wieser, aerojockey, amaury.forgeotdarc, belopolsky, meador.inge, teoliphant
Date 2018-07-16.10:30:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1531737042.74.0.56676864532.issue32780@psf.upfronthosting.co.za>
In-reply-to
Content
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.)
History
Date User Action Args
2018-07-16 10:30:42aerojockeysetrecipients: + aerojockey, teoliphant, amaury.forgeotdarc, belopolsky, meador.inge, Eric.Wieser
2018-07-16 10:30:42aerojockeysetmessageid: <1531737042.74.0.56676864532.issue32780@psf.upfronthosting.co.za>
2018-07-16 10:30:42aerojockeylinkissue32780 messages
2018-07-16 10:30:42aerojockeycreate