Carl Banks <pythond...@aerojockey.com> added the comment:

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.)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32780>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to