예제 #1
0
 def __hasitem__(self, key):
     if type(key) is int:
         key in self._by_id
     else:
         Title.normalize(key) in self._by_name
예제 #2
0
 def __getitem__(self, key):
     if type(key) is int:
         return self._by_id[key]
     else:
         return self._by_name[Title.normalize(key)]