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

Method as_number

crates/vm/src/builtins/bytearray.rs:824–836  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

822
823impl AsNumber for PyByteArray {
824 fn as_number() -> &'static PyNumberMethods {
825 static AS_NUMBER: PyNumberMethods = PyNumberMethods {
826 remainder: Some(|a, b, vm| {
827 if let Some(a) = a.downcast_ref::<PyByteArray>() {
828 a.__mod__(b.to_owned(), vm).to_pyresult(vm)
829 } else {
830 Ok(vm.ctx.not_implemented())
831 }
832 }),
833 ..PyNumberMethods::NOT_IMPLEMENTED
834 };
835 &AS_NUMBER
836 }
837}
838
839impl Iterable for PyByteArray {

Callers

nothing calls this directly

Calls 5

SomeClass · 0.50
to_pyresultMethod · 0.45
__mod__Method · 0.45
to_ownedMethod · 0.45
not_implementedMethod · 0.45

Tested by

no test coverage detected