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

Function hex

crates/vm/src/stdlib/builtins.rs:674–678  ·  view source on GitHub ↗
(number: ArgIndex)

Source from the content-addressed store, hash-verified

672
673 #[pyfunction]
674 fn hex(number: ArgIndex) -> String {
675 let number = number.into_int_ref();
676 let n = number.as_bigint();
677 format!("{n:#x}")
678 }
679
680 #[pyfunction]
681 fn id(obj: PyObjectRef) -> usize {

Callers 15

_pycodecs.pyFile · 0.85
__repr__Method · 0.85
__hash__Method · 0.85
__repr__Method · 0.85
__repr__Method · 0.85
__repr__Method · 0.85
_read_eofMethod · 0.85
pretty_flagsFunction · 0.85
__repr__Method · 0.85
winfo_pathnameMethod · 0.85
build_task_tableFunction · 0.85
_print_cycle_exceptionFunction · 0.85

Calls 2

into_int_refMethod · 0.80
as_bigintMethod · 0.80

Tested by 12

test_openssl_versionMethod · 0.68
__repr__Method · 0.68
test_hexMethod · 0.68
__repr__Method · 0.68
reprMethod · 0.68
__repr__Method · 0.68
hexescapeFunction · 0.68
testUnaryOpsMethod · 0.68
_test_repr_or_strMethod · 0.68