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 loewis, ncoghlan, pitrou, skrah
Date 2012-08-11.09:44:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <20120811094407.GA30058@sleipnir.bytereef.org>
In-reply-to <1344676696.4.0.195802686762.issue15622@psf.upfronthosting.co.za>
Content
Martin v. L??wis <report@bugs.python.org> wrote:
> It's unfortunate that PEP 3118 deviates from the struct module, however,
> memoryview is based onthe buffer interface,and its formatcodes ought to
> conform to the PEP, not to the struct module (IMO).

The struct module itself should conform to PEP-3118, see #3132.

I think the struct module should be updated first. The proliferation of
subtly different format codes is not manageable. For example, if you use
NumPy, there are already differences between NumPy syntax and struct syntax.

Also, one should always be able to unpack the tobytes() representation
using the struct module and get the same result as from flatten(tolist()).

> It's easy to see that it *doesn't* follow the struct syntax, as it is
> possjible to create memoryview objects with other format codes in 3.3.

memoryview has *always* allowed arbitrary format strings during construction.
In 3.3, it keeps this property for backwards compatibility.

It does follow struct syntax whenever it *uses* one of the format codes,
like in tolist().
History
Date User Action Args
2012-08-11 09:44:07skrahsetrecipients: + skrah, loewis, ncoghlan, pitrou
2012-08-11 09:44:06skrahlinkissue15622 messages
2012-08-11 09:44:06skrahcreate