mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
Add __contains__ in dict_items
This commit is contained in:
2
Lib/test/test_dict.py
vendored
2
Lib/test/test_dict.py
vendored
@@ -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):
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user