_Expert Examples

Wildcard pattern in match/case; catches anything

_ internals

How _ works under the hood in CPython.

python
# '_' internals
import dis
import ast

code = "x = 42"
tree = ast.parse(code)
print(ast.dump(tree, indent=2))

Understanding the bytecode and internals helps write more efficient code.

Want to try these examples interactively?

Open Expert Playground