Python 3.11
introduces new two parameters to the dis.dis
function, show_caches
and adaptive
.
>>> import dis >>> >>> help(dis.dis) Help on function dis in module dis: dis(x=None, *, file=None, depth=None, show_caches=False, adaptive=False) Disassemble classes, methods, functions, and other compiled objects. With no argument, disassemble the last traceback. Compiled objects currently include generator objects, async generator objects, and coroutine objects, all of which store their code object in a special attribute.
What does this parameters means in python 3.11?. I did check the result by setting it to True
but the result remains same as like setting it to False
.
>>> dis.dis("a = 1", show_caches=True, adaptive=True)
0 0 RESUME 0
1 2 LOAD_CONST 0 (1)
4 STORE_NAME 0 (a)
6 LOAD_CONST 1 (None)
8 RETURN_VALUE
>>>
>>>
>>> dis.dis("a = 1")
0 0 RESUME 0
1 2 LOAD_CONST 0 (1)
4 STORE_NAME 0 (a)
6 LOAD_CONST 1 (None)
8 RETURN_VALUE