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

Method repr_wtf8

crates/vm/src/stdlib/_operator.rs:435–451  ·  view source on GitHub ↗
(zelf: &Py<Self>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

433 impl Representable for PyAttrGetter {
434 #[inline]
435 fn repr_wtf8(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<Wtf8Buf> {
436 let mut result = Wtf8Buf::from("operator.attrgetter(");
437 if let Some(_guard) = ReprGuard::enter(vm, zelf.as_object()) {
438 let mut first = true;
439 for part in &zelf.attrs {
440 if !first {
441 result.push_str(", ");
442 }
443 first = false;
444 result.push_wtf8(part.as_object().repr(vm)?.as_wtf8());
445 }
446 } else {
447 result.push_str("...");
448 }
449 result.push_char(')');
450 Ok(result)
451 }
452 }
453
454 /// itemgetter(item, /, *items)

Callers

nothing calls this directly

Calls 6

push_wtf8Method · 0.80
as_objectMethod · 0.45
push_strMethod · 0.45
as_wtf8Method · 0.45
reprMethod · 0.45
push_charMethod · 0.45

Tested by

no test coverage detected