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

Method py_isupper

crates/vm/src/anystr.rs:420–430  ·  view source on GitHub ↗

Unified form of CPython functions: Py_bytes_isupper unicode_isupper_impl

(&self)

Source from the content-addressed store, hash-verified

418 // Py_bytes_isupper
419 // unicode_isupper_impl
420 fn py_isupper(&self) -> bool {
421 let mut upper = false;
422 for c in self.elements() {
423 if c.is_lowercase() {
424 return false;
425 } else if !upper && c.is_uppercase() {
426 upper = true
427 }
428 }
429 upper
430 }
431}
432
433/// Tests that the predicate is True on a single value, or if the value is a tuple a tuple, then

Callers 2

isupperMethod · 0.80
isupperMethod · 0.80

Implementers 2

bytes_inner.rscrates/vm/src/bytes_inner.rs
str.rscrates/vm/src/builtins/str.rs

Calls 3

elementsMethod · 0.45
is_lowercaseMethod · 0.45
is_uppercaseMethod · 0.45

Tested by

no test coverage detected