Re: Native object exposing buffer protocol

2018-01-08 Thread breamoreboy
On Saturday, January 6, 2018 at 12:02:18 AM UTC, Rob Gaddi wrote: > I'd like to create a native Python object that exposes the buffer > protocol. Basically, something with a ._data member which is a > bytearray that I can still readinto, make directly into a numpy array, etc. > > I can do it by

Re: Native object exposing buffer protocol

2018-01-08 Thread Rob Gaddi
On 01/05/2018 04:27 PM, Ben Finney wrote: Rob Gaddi writes: I'd like to create a native Python object that exposes the buffer protocol. Basically, something with a ._data member which is a bytearray that I can still readinto, make directly into a numpy array, etc. The “etc.” seems pretty im

Re: Native object exposing buffer protocol

2018-01-05 Thread Ben Finney via Python-list
Rob Gaddi writes: > I'd like to create a native Python object that exposes the buffer > protocol. Basically, something with a ._data member which is a > bytearray that I can still readinto, make directly into a numpy array, > etc. The “etc.” seems pretty important, there. You want the behaviour

Re: Native object exposing buffer protocol

2018-01-05 Thread breamoreboy
On Saturday, January 6, 2018 at 12:02:18 AM UTC, Rob Gaddi wrote: > I'd like to create a native Python object that exposes the buffer > protocol. Basically, something with a ._data member which is a > bytearray that I can still readinto, make directly into a numpy array, etc. > > I can do it by

Native object exposing buffer protocol

2018-01-05 Thread Rob Gaddi
I'd like to create a native Python object that exposes the buffer protocol. Basically, something with a ._data member which is a bytearray that I can still readinto, make directly into a numpy array, etc. I can do it by inheriting the entire thing from bytearray directly, but that gives me a