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

Function text_signature

crates/derive-impl/src/util.rs:726–733  ·  view source on GitHub ↗

Best effort attempt to generate a template from which a __text_signature__ can be created.

(sig: &Signature, name: &str)

Source from the content-addressed store, hash-verified

724// Best effort attempt to generate a template from which a
725// __text_signature__ can be created.
726pub(crate) fn text_signature(sig: &Signature, name: &str) -> String {
727 let signature = func_sig(sig);
728 if signature.starts_with("$self") {
729 format!("{name}({signature})")
730 } else {
731 format!("{}({}, {})", name, "$module", signature)
732 }
733}
734
735pub(crate) fn infer_native_call_flags(sig: &Signature, drop_first_typed: usize) -> TokenStream {
736 // Best-effort mapping of Rust function signatures to CPython-style

Callers 2

gen_impl_itemMethod · 0.85
gen_module_itemMethod · 0.85

Calls 2

func_sigFunction · 0.85
starts_withMethod · 0.80

Tested by

no test coverage detected