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

Method repr_wtf8

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

Source from the content-addressed store, hash-verified

222 impl Representable for PyItertoolsCount {
223 #[inline]
224 fn repr_wtf8(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<Wtf8Buf> {
225 let cur_repr = zelf.cur.read().clone().repr(vm)?;
226 let step = &zelf.step;
227 let mut result = Wtf8Buf::from("count(");
228 result.push_wtf8(cur_repr.as_wtf8());
229 if !vm.bool_eq(step, vm.ctx.new_int(1).as_object())? {
230 result.push_str(", ");
231 result.push_wtf8(step.repr(vm)?.as_wtf8());
232 }
233 result.push_char(')');
234 Ok(result)
235 }
236 }
237
238 #[pyattr]

Callers

nothing calls this directly

Calls 11

push_wtf8Method · 0.80
bool_eqMethod · 0.80
to_stringMethod · 0.80
reprMethod · 0.45
cloneMethod · 0.45
readMethod · 0.45
as_wtf8Method · 0.45
as_objectMethod · 0.45
new_intMethod · 0.45
push_strMethod · 0.45
push_charMethod · 0.45

Tested by

no test coverage detected