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

Method char_all

crates/vm/src/builtins/str.rs:530–539  ·  view source on GitHub ↗
(&self, test: F)

Source from the content-addressed store, hash-verified

528 }
529
530 fn char_all<F>(&self, test: F) -> bool
531 where
532 F: Fn(char) -> bool,
533 {
534 match self.as_str_kind() {
535 PyKindStr::Ascii(s) => s.chars().all(|ch| test(ch.into())),
536 PyKindStr::Utf8(s) => s.chars().all(test),
537 PyKindStr::Wtf8(w) => w.code_points().all(|ch| ch.is_char_and(&test)),
538 }
539 }
540
541 fn repeat(zelf: PyRef<Self>, value: isize, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
542 if value == 0 && zelf.class().is(vm.ctx.types.str_type) {

Callers 7

isalnumMethod · 0.80
isnumericMethod · 0.80
isdigitMethod · 0.80
isdecimalMethod · 0.80
isalphaMethod · 0.80
isprintableMethod · 0.80
isspaceMethod · 0.80

Calls 6

allMethod · 0.80
charsMethod · 0.80
code_pointsMethod · 0.80
is_char_andMethod · 0.80
testFunction · 0.50
as_str_kindMethod · 0.45

Tested by

no test coverage detected