def __contains__(self, key): return _start(key) in self.state
def __getitem__(self, key): try: return self.state[_start(key)], self.state[_end(key)] except KeyError: raise KeyError(key)