Author skrah
Recipients mark.dickinson, meador.inge, pitrou, skrah, vstinner
Date 2011-10-03.14:00:51
SpamBayes Score 1.22726e-08
Marked as misclassified No
Message-id <20111003135737.GA6212@sleipnir.bytereef.org>
In-reply-to <4E89B9E1.3020801@haypocalc.com>
Content
STINNER Victor <report@bugs.python.org> wrote:
> > # Not implemented formats. Ugly, but inevitable. This is the same as
> > # issue #2531: equality is also used for membership testing and must
> > # return a result.
> > a = array.array('u', 'xyz')
> > v = memoryview(a)
> > self.assertNotEqual(v, a)
> > self.assertNotEqual(a, v)
> 
> I don't understand: a buffer format is a format for the struct module, 
> or for the array module?

It's like this: memoryview follows the current struct syntax, which
doesn't have 'u'. memory_richcompare() does not understand 'u', but
is required to return something for __eq__ and __ne__, so it returns
'not equal'.

This isn't so important, since I discovered (see my later post)
that 'u' and 'w' were scheduled for inclusion in the struct
module anyway.

So I think we should focus on whether the proposed 'c', 'u' and 'w'
format specifiers still make sense after the PEP-393 changes.
History
Date User Action Args
2011-10-03 14:00:52skrahsetrecipients: + skrah, mark.dickinson, pitrou, vstinner, meador.inge
2011-10-03 14:00:51skrahlinkissue13072 messages
2011-10-03 14:00:51skrahcreate