Timothy was explaining Python to a colleague from C++ when he got stumped. "So in Python, you can loop over lists, dictionaries, files, strings, ranges, sets... how does for know what to do with all these different types?"

Margaret overheard and smiled. "That's the iterator protocol - one of Python's most elegant designs. Every type that works...