Skip to content

Commit 5480f4c

Browse files
committed
Update cmp of PyUnion
1 parent a443a0b commit 5480f4c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

vm/src/builtins/union.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,14 @@ impl Comparable for PyUnion {
271271
) -> PyResult<PyComparisonValue> {
272272
op.eq_only(|| {
273273
let other = class_or_notimplemented!(Self, other);
274+
let a = PyFrozenSet::from_iter(vm, zelf.args.into_iter().cloned())?;
275+
let b = PyFrozenSet::from_iter(vm, other.args.into_iter().cloned())?;
274276
Ok(PyComparisonValue::Implemented(
275-
zelf.args()
276-
.rich_compare_bool(other.args().as_ref(), PyComparisonOp::Eq, vm)?,
277+
a.into_pyobject(vm).as_object().rich_compare_bool(
278+
b.into_pyobject(vm).as_object(),
279+
PyComparisonOp::Eq,
280+
vm,
281+
)?,
277282
))
278283
})
279284
}

0 commit comments

Comments
 (0)