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

Method eq

crates/vm/src/iter.rs:5–17  ·  view source on GitHub ↗
(self, other: impl PyExactSizeIterator<'a>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

3
4pub trait PyExactSizeIterator<'a>: ExactSizeIterator<Item = &'a PyObjectRef> + Sized {
5 fn eq(self, other: impl PyExactSizeIterator<'a>, vm: &VirtualMachine) -> PyResult<bool> {
6 let lhs = self;
7 let rhs = other;
8 if lhs.len() != rhs.len() {
9 return Ok(false);
10 }
11 for (a, b) in lhs.zip_eq(rhs) {
12 if !vm.identical_or_equal(a, b)? {
13 return Ok(false);
14 }
15 }
16 Ok(true)
17 }
18
19 fn richcompare(
20 self,

Callers

nothing calls this directly

Implementers 1

iter.rscrates/vm/src/iter.rs

Calls 3

zip_eqMethod · 0.80
identical_or_equalMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected