Skip to content

Add richcompare to buffer objects

Bitbucket Importer requested to merge bitbucket/merged-pr-76 into branch/default

Created originally on Bitbucket by coronafire (Andrew Leech)

Was already merged in Bitbucket before import, marked as merged by the import user

Hi, have you got any reservations about adding a richcompare function to minibuffer?

I've grabbed the implementation from bytearray which allows comparison to any other PyBuffer objects.

Currently in my end-use application I'm having to wrap these buffer objects in a memoryview to get a similar comparison. While this works I lose a lot of convenience as it's hard to automatically detect when an object is a ffi.buffer() minibuffer as I can't find a class to check isinstance() against.

  • Add tp_richcompare from 3.5 bytearray to minibuffer (ffi.buffer)

  • Add tests for buffer comparisons

Merge request reports

Loading