Should this fail with a ``KeyError`` if the type isn't present? Or would a different exception (or perhaps a fallback) be preferable?