From 5480f4c671b03a772742a00a9a33fa054828f63e Mon Sep 17 00:00:00 2001 From: Hyunmin Shin Date: Tue, 2 Aug 2022 02:19:57 +0900 Subject: [PATCH] Update cmp of PyUnion --- vm/src/builtins/union.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/vm/src/builtins/union.rs b/vm/src/builtins/union.rs index ad1db983b..31da9a439 100644 --- a/vm/src/builtins/union.rs +++ b/vm/src/builtins/union.rs @@ -271,9 +271,14 @@ impl Comparable for PyUnion { ) -> PyResult { op.eq_only(|| { let other = class_or_notimplemented!(Self, other); + let a = PyFrozenSet::from_iter(vm, zelf.args.into_iter().cloned())?; + let b = PyFrozenSet::from_iter(vm, other.args.into_iter().cloned())?; Ok(PyComparisonValue::Implemented( - zelf.args() - .rich_compare_bool(other.args().as_ref(), PyComparisonOp::Eq, vm)?, + a.into_pyobject(vm).as_object().rich_compare_bool( + b.into_pyobject(vm).as_object(), + PyComparisonOp::Eq, + vm, + )?, )) }) }