How does the Python interpreter execute code? Top-to-bottom, line-by-line. A solid understanding of the Python execution model is critical knowledge for any budding Python programmer. And though the execution model is very simple, its implications are vast.
The Python execution model is incredible simple: top-to-bottom, line-by-line.
And yet this execution model leads to a number of very interesting implications. This talks covers the Python execution model and helps answer questions like:
what are mutable default arguments?
does Python have a compiler? if so, what does it do?
can I import only part of a module?
why doesn’t Python reload modules automatically like Flask?
what happens when I put a for loop in a class body?
can modules have properties?
and more!