I just spent (i.e. wasted) a lot of time tracking down a bug, which it turns out is unexpected, non-Pythonic (IMHO) behavior of Python.
When I run the following: