Clean-up test class for DictMixin.

This commit is contained in:
Raymond Hettinger 2002-12-11 07:16:06 +00:00
parent d2bef8256b
commit 0efa17c943
1 changed files with 6 additions and 2 deletions

View File

@ -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)