Thomas Wouters <tho...@python.org> added the comment:

Setting Py_SIZE of the bytes object is possible, but gross and not how you're 
supposed to operate on bytes.

I'm also not entirely convinced lnotab isn't reused in ways it shouldn't. The 
peephole optimizer already does gross things and is tied very intimately into 
the compiler and assembler structs, and any change I tried caused weird 
side-effects. I'm not comfortable making these changes without extensive 
rewrites of those bits of the code, which Mark Shannon is already working on 
for different reasons.

The current lnotab format doesn't really have the concept of 'no-op fillers', 
because zero-increment entries are used to add to previous entries. Adding the 
concept could mean breaking third-party consumers of lnotab. Of all the uses of 
lnotab that I could find, dis.findlinestarts() was the only one that didn't 
ignore the invalid entries. I think just documenting the current behaviour 
(which, just as a reminder, has been around forever, but is just more obvious 
in Python 3.8) and fixing dis.findlinestarts() is enough of a fix for the 
foreseeable future. See GH-16079.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38115>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to