MCPcopy Index your code
hub / github.com/RustPython/RustPython / finditer

Method finditer

crates/vm/src/stdlib/_sre.rs:316–333  ·  view source on GitHub ↗
(
            zelf: PyRef<Self>,
            string_args: StringArgs,
            vm: &VirtualMachine,
        )

Source from the content-addressed store, hash-verified

314
315 #[pymethod]
316 fn finditer(
317 zelf: PyRef<Self>,
318 string_args: StringArgs,
319 vm: &VirtualMachine,
320 ) -> PyResult<PyCallableIterator> {
321 let scanner = SreScanner {
322 pattern: zelf,
323 string: string_args.string,
324 start: AtomicCell::new(string_args.pos),
325 end: string_args.endpos,
326 must_advance: AtomicCell::new(false),
327 }
328 .into_ref(&vm.ctx);
329 let search = vm.get_str_method(scanner.into(), "search").unwrap()?;
330 let search = ArgCallable::try_from_object(vm, search)?;
331 let iterator = PyCallableIterator::new(search, vm.ctx.none());
332 Ok(iterator)
333 }
334
335 #[pymethod]
336 fn scanner(

Callers 15

_splitlines_no_ffFunction · 0.80
format_stringFunction · 0.80
_tokenizeFunction · 0.80
parseMethod · 0.80
_find_optionsMethod · 0.80
validateMethod · 0.80
test_objecttypesMethod · 0.80
parse_executed_testsMethod · 0.80
parse_methodsMethod · 0.80
test_keep_bufferMethod · 0.80
test_finditerMethod · 0.80
test_bug_581080Method · 0.80

Calls 5

newFunction · 0.85
get_str_methodMethod · 0.80
noneMethod · 0.80
into_refMethod · 0.45
unwrapMethod · 0.45

Tested by 13

parseMethod · 0.64
_find_optionsMethod · 0.64
test_objecttypesMethod · 0.64
parse_executed_testsMethod · 0.64
parse_methodsMethod · 0.64
test_keep_bufferMethod · 0.64
test_finditerMethod · 0.64
test_bug_581080Method · 0.64
test_bug_817234Method · 0.64
test_match_reprMethod · 0.64
test_zerowidthMethod · 0.64
test_bug_34294Method · 0.64