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