Slide 50
Slide 50 text
Metaprogramming in Python - More to Explore
Python has many popular useful features: dir(), help(), decorators, descriptors, metaclasses, & more
But also great support for more ‘esoteric’ uses…
● Handling code as abstract syntax trees - ast module
● Inspecting runtime objects - inspect module(eg: getsource), dir()
● Viewing the interpreter stack - inspect module, inspect.stack()
● Compilation to bytecode at runtime - dis module