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

Method count

crates/vm/src/builtins/str.rs:1281–1285  ·  view source on GitHub ↗
(&self, args: FindArgs)

Source from the content-addressed store, hash-verified

1279
1280 #[pymethod]
1281 fn count(&self, args: FindArgs) -> usize {
1282 let (needle, range) = args.get_value(self.len());
1283 self.as_wtf8()
1284 .py_count(needle.as_wtf8(), range, |h, n| h.find_iter(n).count())
1285 }
1286
1287 #[pymethod]
1288 fn zfill(&self, width: isize) -> Wtf8Buf {

Callers 4

_to_char_idxMethod · 0.45
fill_locals_from_argsMethod · 0.45
traverseMethod · 0.45
py_newMethod · 0.45

Calls 5

py_countMethod · 0.80
find_iterMethod · 0.80
get_valueMethod · 0.45
lenMethod · 0.45
as_wtf8Method · 0.45

Tested by

no test coverage detected