File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3636assert ('a' , 123 ) in d .items ()
3737assert ('b' , 456 ) in d .items ()
3838assert ('a' , 123 , 3 ) not in d .items ()
39- assert ('a' , 123 , 'b' , 456 ) not in d .items ()
39+ assert ('a' , 123 , 'b' , 456 ) not in d .items ()
40+
41+ d = {1 : 10 , "a" : "ABC" , (3 ,4 ): 5 }
42+ assert 1 in d .keys ()
43+ assert (1 ) in d .keys ()
44+ assert "a" in d .keys ()
45+ assert (3 ,4 ) in d .keys ()
46+ assert () not in d .keys ()
47+ assert 10 not in d .keys ()
48+ assert (1 , 10 ) not in d .keys ()
49+ assert "abc" not in d .keys ()
50+ assert ((3 ,4 ),5 ) not in d .keys ()
Original file line number Diff line number Diff line change @@ -956,7 +956,12 @@ trait ViewSetOps: DictView {
956956
957957impl ViewSetOps for PyDictKeys { }
958958#[ pyimpl( with( DictView , Comparable , Iterable , ViewSetOps ) ) ]
959- impl PyDictKeys { }
959+ impl PyDictKeys {
960+ #[ pymethod( magic) ]
961+ fn contains ( zelf : PyRef < Self > , key : PyObjectRef , vm : & VirtualMachine ) -> PyResult < bool > {
962+ zelf. dict ( ) . contains ( key, vm)
963+ }
964+ }
960965
961966impl ViewSetOps for PyDictItems { }
962967#[ pyimpl( with( DictView , Comparable , Iterable , ViewSetOps ) ) ]
You can’t perform that action at this time.
0 commit comments