cpy3 icon indicating copy to clipboard operation
cpy3 copied to clipboard

buffer protocol

Open christian-korneck opened this issue 3 years ago • 5 comments

I wonder if it would make sense to add the Python3 C-API functions related to the Python buffer protocol. This might make it easier to share bytes between Go and Python? (i.e. io.Reader/io.Writer stuff).

https://docs.python.org/3/c-api/buffer.html

christian-korneck avatar May 30 '22 22:05 christian-korneck

@christian-korneck your dream is complete

Let's try it, python bindings cgo-less

https://github.com/aadog/py3-go

aadog avatar Aug 12 '22 04:08 aadog

@aadog do you have a buffer protocol example?

christian-korneck avatar Aug 15 '22 14:08 christian-korneck

What is he

aadog avatar Aug 16 '22 12:08 aadog

go to python or python to go,They are done automatically

string->str intT ->intT

If it is not supported, please return * pyobject to convert manually, or modify pyconvert

https://github.com/aadog/py3-go/blob/master/PyConvert.go

aadog avatar Aug 16 '22 12:08 aadog

All this should be simple, but I don't know what type of byte should be converted to Python

aadog avatar Aug 16 '22 12:08 aadog