◐ Shell
clean mode source ↗

Message 260918 - Python tracker

Well, now that I'm thinking about it, you could synthesize a bytecode stream trivially and have a much better test.  This is completely off the top of my head, so take it is guaranteed to (probably) not work as written, but it should get you started:

from opcodes import *
import dis
bytecode = (
    chr(EXTENDED_ARG) + chr(1) + chr(0) + 
    chr(JUMP_IF_TRUE_OR_POP) + chr(0) + chr(0)
)
print(dis.findlabels(bytecode))