Skip to content

Commit

Permalink
Revert changes to autoapi/_mapper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss committed Oct 12, 2024
1 parent c333232 commit 48ae689
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions autoapi/_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,8 @@ def _record_typehints(self, obj):
isinstance(obj, (PythonClass, PythonFunction, PythonMethod))
and not obj.overloads
) or isinstance(obj, PythonProperty):
obj_annotations = {}

include_return_annotation = True
obj_data = obj.obj
if isinstance(obj, PythonClass):
Expand All @@ -628,10 +630,9 @@ def _record_typehints(self, obj):
else:
return

obj_annotations = {
name: annotation for _, name, annotation, _ in obj_data["annotations"]
if name and annotation
}
for _, name, annotation, _ in obj_data["args"]:
if name and annotation:
obj_annotations[name] = annotation

return_annotation = obj_data["return_annotation"]
if include_return_annotation and return_annotation:
Expand Down

0 comments on commit 48ae689

Please # to comment.