Using signature() function It takes callable as a parameter and returns the annotation . It raises a value Error if no signature is provided. If the Invalid type object is given then it throws a Type Error. Syntax: inspect.signature(callable, *, follow_wrapped=True)