Python in a nutshell:
Python in a Nutshell - Oreilly publishing.
Page 166 - Match objects.
Whenever you perform a regular expression match, you are returned an object which has every piece of information you could ever want, as well as a callback interface. It's more powerful than any regular expression interface I've ever seen.
page 67 - Generators.
Seems like a rather clever idea - your program can keep calling "yield" instead of return, and it freezes until the next time it is called, at which point it can resume iteration through wahtever it was iterating. Makes writing iterators a snap. It might help me make the c++ comment processor a little more elegant.
Page 166 - Match objects.
Whenever you perform a regular expression match, you are returned an object which has every piece of information you could ever want, as well as a callback interface. It's more powerful than any regular expression interface I've ever seen.
page 67 - Generators.
Seems like a rather clever idea - your program can keep calling "yield" instead of return, and it freezes until the next time it is called, at which point it can resume iteration through wahtever it was iterating. Makes writing iterators a snap. It might help me make the c++ comment processor a little more elegant.