Skip to content

Commit 03605ad

Browse files
committed
runtime: fix __ne__ generic implementation
Forgot to invert the result of __eq__
1 parent 91a257e commit 03605ad

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/runtime/PyObject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ PyResult<PyObject *> PyObject::__ne__(const PyObject *other) const
11611161
if (!type_prototype().__eq__.has_value()) { return Ok(not_implemented()); }
11621162
return call_slot(*type_prototype().__eq__, this, other).and_then([](PyObject *obj) {
11631163
return truthy(obj, VirtualMachine::the().interpreter()).and_then([](bool value) {
1164-
return Ok(value ? py_true() : py_false());
1164+
return Ok(value ? py_false() : py_true());
11651165
});
11661166
});
11671167
}

0 commit comments

Comments
 (0)