Dennis Sweeney <sweeney.dennis...@gmail.com> added the comment:

Why not just fix bogus_code_obj.py?

Something like this (using the replace method) would make it more future-proof 
to similar changes in the code object constructor signature (and be more 
readable!):

import dis
POP_TOP = dis.opmap['POP_TOP']
wordcode = bytes([POP_TOP, 0] * 10)
f = lambda: None
f.__code__ = f.__code__.replace(co_code=wordcode)
f()

----------

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

Reply via email to