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

Method as_number

crates/vm/src/builtins/mappingproxy.rs:258–277  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

256
257impl AsNumber for PyMappingProxy {
258 fn as_number() -> &'static PyNumberMethods {
259 static AS_NUMBER: PyNumberMethods = PyNumberMethods {
260 or: Some(|a, b, vm| {
261 if let Some(a) = a.downcast_ref::<PyMappingProxy>() {
262 a.__or__(b.to_pyobject(vm), vm)
263 } else {
264 Ok(vm.ctx.not_implemented())
265 }
266 }),
267 inplace_or: Some(|a, b, vm| {
268 if let Some(a) = a.downcast_ref::<PyMappingProxy>() {
269 a.__ior__(b.to_pyobject(vm), vm)
270 } else {
271 Ok(vm.ctx.not_implemented())
272 }
273 }),
274 ..PyNumberMethods::NOT_IMPLEMENTED
275 };
276 &AS_NUMBER
277 }
278}
279
280impl Iterable for PyMappingProxy {

Callers

nothing calls this directly

Calls 5

SomeClass · 0.50
__or__Method · 0.45
to_pyobjectMethod · 0.45
not_implementedMethod · 0.45
__ior__Method · 0.45

Tested by

no test coverage detected