Add "annotate" SET_FUNCTION_ATTRIBUTE bit to dis. by larryhastings · Pull Request #124566 · python/cpython
fn_with_annotate_str = """ def foo(a: int, b: str) -> str: return a * b """
dis_fn_with_annotate_str = """\ 0 RESUME 0
2 LOAD_CONST 0 (<code object __annotate__ at 0x..., file "<dis>", line 2>) MAKE_FUNCTION LOAD_CONST 1 (<code object foo at 0x..., file "<dis>", line 2>) MAKE_FUNCTION SET_FUNCTION_ATTRIBUTE 16 (annotate) STORE_NAME 0 (foo) RETURN_CONST 2 (None) """
compound_stmt_str = """\ x = 0 while 1:
def test_disassemble_bytes(self):