Add __contains__ in dict_items

This commit is contained in:
Jack-R-lantern
2021-10-09 17:48:55 +09:00
parent aef89ceaec
commit 8056604102
2 changed files with 1 additions and 3 deletions

View File

@@ -1300,8 +1300,6 @@ class DictTest(unittest.TestCase):
except RuntimeError: # implementation defined
pass
# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_dictitems_contains_use_after_free(self):
class X:
def __eq__(self, other):

View File

@@ -997,7 +997,7 @@ impl PyDictItems {
}
let key = needle.fast_getitem(0);
let found = zelf.dict().contains(key.clone(), vm)?;
if found == false {
if !found {
return Ok(false);
}
let value = needle.fast_getitem(1);