[issue36839] Support the buffer protocol in code objects

Serhiy Storchaka report at bugs.python.org
Tue Jun 4 02:16:04 EDT 2019


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Yet one consideration. The bytecode is actually a wordcode, a sequence of 16-bit words, and the start of the array must be properly aligned. There is no problem if it is a data of the bytes object, but if you have a mapping of the pyc file the alignment is not guarantied. You need to change also the marshal protocol or save the bytecode in other file. This is a large change.

So you need to make several large changes (changes in the import system, change in the pyc file) for using this feature. Supporting the buffer protocol in code objects is minor change to this. If you need to patch other parts of Python it is not hard to patch also the code object in your custom build. Other Python users will not have benefit from this.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36839>
_______________________________________


More information about the Python-bugs-list mailing list