@@ -2,9 +2,9 @@ use super::VirtualMachine;
22use crate :: stdlib:: warnings;
33use crate :: {
44 PyRef ,
5- builtins:: { PyInt , PyIntRef , PyStr , PyStrRef , PyUtf8Str } ,
5+ builtins:: { PyInt , PyStr , PyStrRef , PyUtf8Str } ,
66 object:: { AsObject , PyObject , PyObjectRef , PyResult } ,
7- protocol:: { PyIterReturn , PyNumberBinaryOp , PyNumberTernaryOp , PySequence } ,
7+ protocol:: { PyNumberBinaryOp , PyNumberTernaryOp , PySequence } ,
88 types:: PyComparisonOp ,
99} ;
1010use num_traits:: ToPrimitive ;
@@ -529,26 +529,6 @@ impl VirtualMachine {
529529 self . format ( obj, format_spec) ?. try_into_utf8 ( self )
530530 }
531531
532- // https://docs.python.org/3/reference/expressions.html#membership-test-operations
533- fn _membership_iter_search (
534- & self ,
535- haystack : & PyObject ,
536- needle : PyObjectRef ,
537- ) -> PyResult < PyIntRef > {
538- let iter = haystack. get_iter ( self ) ?;
539- loop {
540- if let PyIterReturn :: Return ( element) = iter. next ( self ) ? {
541- if self . bool_eq ( & element, & needle) ? {
542- return Ok ( self . ctx . new_bool ( true ) ) ;
543- } else {
544- continue ;
545- }
546- } else {
547- return Ok ( self . ctx . new_bool ( false ) ) ;
548- }
549- }
550- }
551-
552532 pub fn _contains ( & self , haystack : & PyObject , needle : & PyObject ) -> PyResult < bool > {
553533 let seq = haystack. to_sequence ( ) ;
554534 seq. contains ( needle, self )
0 commit comments