Here I would add a defensive else in this form:
```python
else:
    raise NotImplemented("Unknown key type: %s" % key_type)
```