No, this is on purpose. The API for the hazard getter (the undocumented one in my mind, of course) says that if a hazard cannot be found for a given site, then the getter should raise a KeyError. Raising an exception is a communication mechanism here, as the StopIteration mechanism in generators. Perhaps I could use a custom exception instead of KeyError (a MissingHazard one).