search engine: first draft of code and also (slightly desynchronized) chapter text!

Thank you for explaining your confusion! Probably it would be useful to explain what the context managers for file objects do, since the intended audience for this book includes even people who haven't used context managers before. Maybe also renaming the argument from `context_manager` to something like `input_stream` might help.

This may just be the purist in me speaking, but I kind of hate boolean flags and having the read/write functions take care of opening; it eliminates composability. The current `read_tuples` function can read from a database blob, from an HTTP response, or from a bzip2ed file. If it opened the file itself, it couldn't do that any more.

Still, extra functionality that isn't being used is a poor argument for much of anything.