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

Method repr

crates/vm/src/builtins/str.rs:687–693  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

685
686 #[inline]
687 pub(crate) fn repr(&self, vm: &VirtualMachine) -> PyResult<String> {
688 use crate::literal::escape::UnicodeEscape;
689 UnicodeEscape::new_repr(self.as_wtf8())
690 .str_repr()
691 .to_string()
692 .ok_or_else(|| vm.new_overflow_error("string is too long to generate repr"))
693 }
694
695 #[pymethod]
696 fn lower(&self) -> Self {

Callers 15

repr_strMethod · 0.45
repr_strMethod · 0.45
repr_strMethod · 0.45
repr_strMethod · 0.45
repr_wtf8Method · 0.45
repr_strMethod · 0.45
slot_strMethod · 0.45
float_from_stringFunction · 0.45
repr_wtf8Method · 0.45
repr_strMethod · 0.45
repr_wtf8Method · 0.45
repr_wtf8Method · 0.45

Calls 4

ok_or_elseMethod · 0.80
to_stringMethod · 0.80
str_reprMethod · 0.80
as_wtf8Method · 0.45

Tested by

no test coverage detected