Awesome, it now looks a more lot like what you wrote. I ended up needing self.closed to implement eof().