A Signature object represents the call signature of a function and its return annotation. For each parameter accepted by the function it stores a Parameter object in its parameters collection.
class inspect.Signature(parameters=None, *, return_annotation=Signature.empty)
>>> 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'"
class MySignature(Signature):
pass
sig = MySignature.from_callable(sum)
assert isinstance(sig, MySignature)