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

Method contains

crates/vm/src/bytes_inner.rs:319–324  ·  view source on GitHub ↗
(&self, needle: Either<Self, PyIntRef>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

317 }
318
319 pub fn contains(&self, needle: Either<Self, PyIntRef>, vm: &VirtualMachine) -> PyResult<bool> {
320 Ok(match needle {
321 Either::A(byte) => self.elements.contains_str(byte.elements.as_slice()),
322 Either::B(int) => self.elements.contains(&int.as_bigint().byte_or(vm)?),
323 })
324 }
325
326 pub fn isalnum(&self) -> bool {
327 !self.elements.is_empty()

Callers 4

translateMethod · 0.45
stripMethod · 0.45
lstripMethod · 0.45
rstripMethod · 0.45

Calls 3

byte_orMethod · 0.80
as_bigintMethod · 0.80
as_sliceMethod · 0.45

Tested by

no test coverage detected