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

Method __sub__

crates/vm/src/builtins/set.rs:624–638  ·  view source on GitHub ↗
(
        &self,
        other: PyObjectRef,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

622 }
623
624 fn __sub__(
625 &self,
626 other: PyObjectRef,
627 vm: &VirtualMachine,
628 ) -> PyResult<PyArithmeticValue<Self>> {
629 if let Ok(other) = AnySet::try_from_object(vm, other) {
630 Ok(PyArithmeticValue::Implemented(self.op(
631 other,
632 PySetInner::difference,
633 vm,
634 )?))
635 } else {
636 Ok(PyArithmeticValue::NotImplemented)
637 }
638 }
639
640 fn __rsub__(
641 zelf: PyRef<Self>,

Callers 1

as_numberMethod · 0.45

Calls 1

opMethod · 0.80

Tested by

no test coverage detected