3 ms·
For anyone wanting to play around with this online, Compiler Explorer [0] supports displaying Python bytecode, such as this example. [1] [0] https://godbolt.or
by jonpalmisc 5y ago
For anyone wanting to play around with this online, Compiler Explorer [0] supports displaying Python bytecode, such as this example. [1]
[0] https://godbolt.org https://godbolt.org
[1] https://godbolt.org/z/5sYs7dT54 https://godbolt.org/z/5sYs7dT54
- masklinn 5y agoThough playing around with this offline is not exactly difficult either: you can just invoke `dis.dis(codestring)` at the command-line, or use `dis.dis` as a decorator when defining a function (it automatically prints out the bytecode). Sadly `-mdis` requires feeding a file by path or data through stdin, so for mucking around it’s not the best.