diff --git a/ptpython/signatures.py b/ptpython/signatures.py index 228b99b2..8256f707 100644 --- a/ptpython/signatures.py +++ b/ptpython/signatures.py @@ -84,10 +84,13 @@ def from_inspect_signature( ) -> "Signature": parameters = [] - def get_annotation_name(annotation: object) -> str: + def get_annotation_name(annotation: object) -> None: """ Get annotation as string from inspect signature. """ + if annotation == inspect.Parameter.empty: + return None + try: # In case the annotation is a class like "int", "float", ... return str(annotation.__name__) # type: ignore