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

Method new

crates/vm/src/builtins/range.rs:230–237  ·  view source on GitHub ↗
(cls: PyTypeRef, stop: ArgIndex, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

228)]
229impl PyRange {
230 fn new(cls: PyTypeRef, stop: ArgIndex, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
231 Self {
232 start: vm.ctx.new_pyref(0),
233 stop: stop.into(),
234 step: vm.ctx.new_pyref(1),
235 }
236 .into_ref_with_type(vm, cls)
237 }
238
239 fn new_from(
240 cls: PyTypeRef,

Callers

nothing calls this directly

Calls 2

into_ref_with_typeMethod · 0.80
new_pyrefMethod · 0.80

Tested by

no test coverage detected