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

Method as_number

crates/vm/src/builtins/bytes.rs:672–684  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

670
671impl AsNumber for PyBytes {
672 fn as_number() -> &'static PyNumberMethods {
673 static AS_NUMBER: PyNumberMethods = PyNumberMethods {
674 remainder: Some(|a, b, vm| {
675 if let Some(a) = a.downcast_ref::<PyBytes>() {
676 a.__mod__(b.to_owned(), vm).to_pyresult(vm)
677 } else {
678 Ok(vm.ctx.not_implemented())
679 }
680 }),
681 ..PyNumberMethods::NOT_IMPLEMENTED
682 };
683 &AS_NUMBER
684 }
685}
686
687impl Hashable for PyBytes {

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