This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Dennis Sweeney
Recipients BTaskaya, Dennis Sweeney, eric.smith, sbz
Date 2020-12-08.03:55:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Why not just fix

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)
Date User Action Args
2020-12-08 03:55:17Dennis Sweeneysetrecipients: + Dennis Sweeney, eric.smith, sbz, BTaskaya
2020-12-08 03:55:17Dennis Sweeneysetmessageid: <>
2020-12-08 03:55:17Dennis Sweeneylinkissue42422 messages
2020-12-08 03:55:17Dennis Sweeneycreate