Kaydet (Commit) 0efa17c9 authored tarafından Raymond Hettinger's avatar Raymond Hettinger

Clean-up test class for DictMixin.

üst d2bef825
......@@ -155,8 +155,12 @@ class SeqDict(DictMixin):
raise KeyError
return self.valuelist[i]
def __setitem__(self, key, value):
self.keylist.append(key)
self.valuelist.append(value)
try:
i = self.keylist.index(key)
self.valuelist[i] = value
except ValueError:
self.keylist.append(key)
self.valuelist.append(value)
def __delitem__(self, key):
try:
i = self.keylist.index(key)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment