##// END OF EJS Templates
sortdict: have update() accept either dict or iterable of key/value pairs...
Yuya Nishihara -
r24236:de14c397 default
parent child Browse files
Show More
@@ -359,8 +359,10 class sortdict(dict):
359 def __iter__(self):
359 def __iter__(self):
360 return self._list.__iter__()
360 return self._list.__iter__()
361 def update(self, src):
361 def update(self, src):
362 for k in src:
362 if isinstance(src, dict):
363 self[k] = src[k]
363 src = src.iteritems()
364 for k, v in src:
365 self[k] = v
364 def clear(self):
366 def clear(self):
365 dict.clear(self)
367 dict.clear(self)
366 self._list = []
368 self._list = []
General Comments 0
You need to be logged in to leave comments. Login now