mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
Clean-up test class for DictMixin.
This commit is contained in:
parent
d2bef8256b
commit
0efa17c943
1 changed files with 6 additions and 2 deletions
|
|
@ -155,8 +155,12 @@ def __getitem__(self, key):
|
|||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue