PyDocs

Nav

Python Runtime Services

Signature.replace

  • Signature.replace(*[, parameters][, return_annotation])
Creates a customized copy of the Signature.
Pass 'parameters' and/or 'return_annotation' arguments
to override them in the new copy.
1 Example
>>> def test(a, b):
...     pass
...
>>> sig = signature(test)
>>> new_sig = sig.replace(return_annotation="new return anno")
>>> str(new_sig)
"(a, b) -> 'new return anno'"
from the Python docs
See Also
No see-alsos for inspect/Signature.replace
0 Notes
No notes for Signature.replace