Skip to content

Commit f6e6ef0

Browse files
committed
objint __pos__ returns Int object
This fixes test_bool.test_math
1 parent 7f191aa commit f6e6ef0

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Lib/test/test_bool.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ def test_float(self):
5151
self.assertEqual(float(True), 1.0)
5252
self.assertIsNot(float(True), True)
5353

54-
# TODO: RUSTPYTHON
55-
@unittest.expectedFailure
5654
def test_math(self):
5755
self.assertEqual(+False, 0)
5856
self.assertIsNot(+False, False)

vm/src/obj/objint.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,8 @@ impl PyInt {
462462
}
463463

464464
#[pymethod(name = "__pos__")]
465-
fn pos(zelf: PyRef<Self>, _vm: &VirtualMachine) -> PyIntRef {
466-
zelf
465+
fn pos(&self, _vm: &VirtualMachine) -> BigInt {
466+
self.value.clone()
467467
}
468468

469469
#[pymethod(name = "__float__")]

0 commit comments

Comments
 (0)