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

Method __int__

crates/vm/src/builtins/int.rs:636–641  ·  view source on GitHub ↗
(self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

634#[pyclass]
635impl PyRef<PyInt> {
636 pub(crate) fn __int__(self, vm: &VirtualMachine) -> PyRefExact<PyInt> {
637 self.into_exact_or(&vm.ctx, |zelf| unsafe {
638 // TODO: this is actually safe. we need better interface
639 PyRefExact::new_unchecked(vm.ctx.new_bigint(&zelf.value))
640 })
641 }
642}
643
644impl Comparable for PyInt {

Callers 6

__trunc__Method · 0.45
__floor__Method · 0.45
__ceil__Method · 0.45
conjugateMethod · 0.45
realMethod · 0.45
numeratorMethod · 0.45

Calls 2

into_exact_orMethod · 0.80
new_bigintMethod · 0.80

Tested by

no test coverage detected