@@ -15,6 +15,7 @@ use crate::{
1515 function:: {
1616 ArgIterable , FuncArgs , KwArgs , OptionalArg , PyArithmeticValue :: * , PyComparisonValue ,
1717 } ,
18+ iter:: PyExactSizeIterator ,
1819 protocol:: { PyIterIter , PyIterReturn , PyMappingMethods , PySequenceMethods } ,
1920 recursion:: ReprGuard ,
2021 types:: {
@@ -998,23 +999,30 @@ 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,
10051006 !zelf. class( ) . is( vm. ctx. types. dict_keys_type) ,
10061007 vm,
1007- )
1008+ ) ;
10081009 }
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 lhs: Vec < PyObjectRef > = zelf. as_object ( ) . to_owned ( ) . try_into_value ( vm) ?;
1022+ let rhs: Vec < PyObjectRef > = other. to_owned ( ) . try_into_value ( vm) ?;
1023+ lhs. iter ( )
1024+ . richcompare ( rhs. iter ( ) , op, vm)
1025+ . map ( PyComparisonValue :: Implemented )
10181026 }
10191027
10201028 #[ pymethod]
0 commit comments