[sorry if you see this twice, didn't seem to get through the first time] If the safe buffer PEP would be accepted and implemented, here's my proposal for the bytes object. The bytes object uses the safe buffer interface to gain access to the byte array it exposes. The bytes type would probably accept the following arguments: PyObject *type - the (bytes) type or subtype to create PyObject *obj - the object exposing the safe buffer interface size_t offset - starting offset of obj's memory block size_t length - number of bytes to use (0 for all) and maybe a flag requesting read or read/write access. A convention could be that if a NULL is passed for obj, then the bytes object itself allocates a memory block of length length. Of course the bytes object itself would also expose the safe buffer interface. And slicing, but not repetition. Isn't the above sufficient (provided that we somehow add the pickle stuff into this picture)? Thomas
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4