From 42d9d270313a301361b9232b672cde93e7225d2a Mon Sep 17 00:00:00 2001 From: JaeyoungAhn Date: Sun, 26 Mar 2023 13:59:01 +0900 Subject: [PATCH 1/2] solved test case error for test_dictviews.py from object.rs --- vm/src/protocol/object.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vm/src/protocol/object.rs b/vm/src/protocol/object.rs index 4cdcb68257..3d81c0d506 100644 --- a/vm/src/protocol/object.rs +++ b/vm/src/protocol/object.rs @@ -333,6 +333,13 @@ impl PyObject { opid: PyComparisonOp, vm: &VirtualMachine, ) -> PyResult { + if self.is(other) { + if opid == PyComparisonOp::Eq { + return Ok(true); + } else if opid == PyComparisonOp::Ne { + return Ok(false); + } + } match self._cmp(other, opid, vm)? { Either::A(obj) => obj.try_to_bool(vm), Either::B(other) => Ok(other), From 3c799b70cdd30237cc6ae52834f1adf2361d2b46 Mon Sep 17 00:00:00 2001 From: JaeyoungAhn Date: Sun, 26 Mar 2023 14:00:08 +0900 Subject: [PATCH 2/2] remove solved TODO --- Lib/test/test_dictviews.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/Lib/test/test_dictviews.py b/Lib/test/test_dictviews.py index 172b98aa68..6e7140314f 100644 --- a/Lib/test/test_dictviews.py +++ b/Lib/test/test_dictviews.py @@ -292,8 +292,6 @@ def test_copy(self): self.assertRaises(TypeError, copy.copy, d.values()) self.assertRaises(TypeError, copy.copy, d.items()) - # TODO: RUSTPYTHON - @unittest.expectedFailure def test_compare_error(self): class Exc(Exception): pass