Or Else! An Exploration of Obscure Control Flow
summary
Claims several concrete behaviors: for-else executes when loop exhausts iterable, try-except-else runs only on no-exception, decorators execute at definition time and can start loops immediately, and generators support bidirectional send/throw plus StopIteration.value. Tools demonstrated include a published do while package on Pippi implements a post-tested loop via decorator, and a toy text-adventure whose core engine is ~28 lines with the repo under 200 lines. Live demos run and the do-while implementation actually works as shown.
AI-written summary · about
chapters (10)
- 0:00Welcome
- 1:03Control flow in Python
- 2:07Comprehensions readability
- 4:13Else block
- 7:05Decorators as control flow
- 9:34Until and do-while loops
- 12:43Generators bidirectional
- 16:16State machine with generators
- 18:43Text adventure game
- 21:40Closing
related talks
25mLazy Looping: The Next Iteration
31mDon't Do This
51mIt Really is Easier to Ask for Forgiveness (than Permission)
02mTutorial Sneak Peek: "Lazy Looping in Practice..."
21mBecome a Better Pythonista by Abusing List Comprehensions and :=
01h 26mBeyond Python Enhanced Generators
28mIf an asyncio Task fails in the woods and nobody is around to see it, does i....
44mIterables and Iterators: Going Loopy With Python
