comparison src/browser/collections.py @ 661:2664fe93ceb3 frontends_multi_profiles

browser_side: implements collections.OrderedDict.__contains__ to fix an error while doing "presence in C.PRESENCE"
author souliane <souliane@mailoo.org>
date Tue, 03 Mar 2015 06:24:27 +0100
parents a5019e62c3e9
children 690a8a80a0ad
comparison
equal deleted inserted replaced
660:267761bf7f08 661:2664fe93ceb3
40 return self.__internal_dict[key] 40 return self.__internal_dict[key]
41 41
42 def __delitem__(self, key): 42 def __delitem__(self, key):
43 del self.__internal_dict[key] 43 del self.__internal_dict[key]
44 self.__keys.remove(key) 44 self.__keys.remove(key)
45
46 def __contains__(self, key):
47 return key in self.__keys
45 48
46 def clear(self): 49 def clear(self):
47 self.__internal_dict.clear() 50 self.__internal_dict.clear()
48 del self.__keys[:] 51 del self.__keys[:]
49 52
130 if len(args) == 2: 133 if len(args) == 2:
131 return args[1] 134 return args[1]
132 raise KeyError(args[0]) 135 raise KeyError(args[0])
133 self.__keys.remove(args[0]) 136 self.__keys.remove(args[0])
134 137
135 def viewitems(): 138 def viewitems(self):
136 raise NotImplementedError 139 raise NotImplementedError
137 140
138 def viewkeys(): 141 def viewkeys(self):
139 raise NotImplementedError 142 raise NotImplementedError
140 143
141 def viewvalues(): 144 def viewvalues(self):
142 raise NotImplementedError 145 raise NotImplementedError