Did you know you can see how #Python parses your code? 🐍🤯
Breaking a .py file into a tree of "tokens" 🪙
python3 -m tokenize hi.py
Turning that into an "abstract syntax tree" 🎋
python3 -m ast hi.py
Then "disassembling" that to bytecode 🤖
python3 -m dis hi.py
When people say "comprehensions generate fewer operations than loops", they used dis.
I used the ast module when I made my undataclass script: https://www.pythonmorsels.com/undataclass/
More in this PyCascades talk: https://m.youtube.com/watch?v=RcGshw0tzoc&feature=youtu.be