@@ -26,6 +26,7 @@ use crate::{
2626} ;
2727use rustpython_common:: lock:: PyMutex ;
2828use std:: fmt;
29+ use crate :: sequence:: ObjectSequenceOp ;
2930
3031pub type DictContentType = dictdatatype:: Dict ;
3132
@@ -998,7 +999,7 @@ trait ViewSetOps: DictView {
998999 ) -> PyResult < PyComparisonValue > {
9991000 match_class ! ( match other {
10001001 ref dictview @ Self => {
1001- PyDict :: inner_cmp(
1002+ return PyDict :: inner_cmp(
10021003 zelf. dict( ) ,
10031004 dictview. dict( ) ,
10041005 op,
@@ -1009,12 +1010,22 @@ trait ViewSetOps: DictView {
10091010 ref _set @ PySet => {
10101011 let inner = Self :: to_set( zelf. to_owned( ) , vm) ?;
10111012 let zelf_set = PySet { inner } . into_pyobject( vm) ;
1012- PySet :: cmp( zelf_set. downcast_ref( ) . unwrap( ) , other, op, vm)
1013+ return PySet :: cmp( zelf_set. downcast_ref( ) . unwrap( ) , other, op, vm) ;
10131014 }
1015+ ref _dictitems @ PyDictItems => { }
1016+ ref _dictkeys @ PyDictKeys => { }
10141017 _ => {
1015- Ok ( NotImplemented )
1018+ return Ok ( NotImplemented ) ;
10161019 }
1017- } )
1020+ } ) ;
1021+ let self_vec: Vec < PyObjectRef > = zelf. as_object ( ) . to_owned ( ) . try_into_value ( vm) ?;
1022+ let other_vec: Vec < PyObjectRef > = other. to_owned ( ) . try_into_value ( vm) ?;
1023+ let res = self_vec. eq ( vm, & other_vec) ?;
1024+ match op {
1025+ PyComparisonOp :: Eq => Ok ( Implemented ( res) ) ,
1026+ PyComparisonOp :: Ne => Ok ( Implemented ( !res) ) ,
1027+ _ => Ok ( NotImplemented ) ,
1028+ }
10181029 }
10191030
10201031 #[ pymethod]
0 commit comments