It Really is Easier to Ask for Forgiveness (than Permission)
summary
Argues that Python’s EAFP over LBYL style is intentional and often faster, walks the exception class hierarchy, shows live Jupyter examples (sys.exit → SystemExit, iterator exhaustion → StopIteration/GeneratorExit, attribute lookup → AttributeError→__getattr__), warns against bare except/try-except-pass and oversized try blocks, and runs a timing where a for-loop that uses iterator exceptions ends up two orders of magnitude faster than a while-loop version that avoids exceptions.
AI-written summary · about
chapters (13)
- 0:00Start
- 5:50When Things Go Wrong
- 9:16Java
- 10:07Javascript
- 11:37Python
- 13:50Pythons Exception System
- 15:06Raise an Exception
- 19:01Exception Hierarchy
- 20:46Custom Subclassed Exceptions
- 27:01Handling an Exception
- 35:47The Harry Potter Theory
- 41:37End-of-File Error
- 44:04Generator Exit Exception








