Proposal: int.from_bytes and int.to_bytes, but for buffers
Discussions on Python.org
Proposal: int.from_bytes and int.to_bytes, but for buffers
Right now you have to take a slice before passing any data to int.from_bytes if you want to parse int at a certain offset. Which is extra allocations, even if it is something as cheap as memoryview. The same goes for int.to_bytes, it allocates bytes every time. By having something like e.g. int.from_buffer(buffer, size, offset=0, byteorder='big', signed=False) and int.to_buffer(self, buffer, size, offset=0, byteorder='big', signed=False) it will make it possible to squish extra performance in p...
0 comments
No comments yet.