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

Method new_bigint

crates/vm/src/vm/context.rs:493–501  ·  view source on GitHub ↗
(&self, i: &BigInt)

Source from the content-addressed store, hash-verified

491
492 #[inline]
493 pub fn new_bigint(&self, i: &BigInt) -> PyIntRef {
494 if let Some(i) = i.to_i32()
495 && Self::INT_CACHE_POOL_RANGE.contains(&i)
496 {
497 let inner_idx = (i - Self::INT_CACHE_POOL_MIN) as usize;
498 return self.int_cache_pool[inner_idx].clone();
499 }
500 PyInt::from(i.clone()).into_ref(self)
501 }
502
503 #[inline]
504 pub fn new_float(&self, value: f64) -> PyRef<PyFloat> {

Callers 7

execute_binary_op_intMethod · 0.80
try_index_optMethod · 0.80
as_integer_ratioMethod · 0.80
__int__Method · 0.80
clone_exactMethod · 0.80
as_integer_ratioMethod · 0.80
make_constantMethod · 0.80

Calls 3

containsMethod · 0.45
cloneMethod · 0.45
into_refMethod · 0.45

Tested by

no test coverage detected