Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/main' into pep649-fakevalue
  • Loading branch information
JelleZijlstra committed Sep 26, 2024
commit f77be3733e2c8d0052cba0d7e11118b930155caf
2 changes: 1 addition & 1 deletion Lib/annotationlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ def get_annotations(
return ann
# But if we didn't get it, we use __annotations__ instead.
ann = _get_dunder_annotations(obj)
return ann
return annotations_to_source(ann)
case Format.VALUE_WITH_FAKE_GLOBALS:
raise ValueError("The VALUE_WITH_FAKE_GLOBALS format is for internal use only")
case _:
Expand Down
4 changes: 2 additions & 2 deletions Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2938,7 +2938,7 @@ def annotate(format):
case annotationlib.Format.VALUE | annotationlib.Format.FORWARDREF:
return checked_types
case annotationlib.Format.SOURCE:
return _convert_to_source(types)
return annotationlib.annotations_to_source(types)
case _:
raise NotImplementedError(format)
return annotate
Expand Down Expand Up @@ -3229,7 +3229,7 @@ def __annotate__(format):
for n, tp in own.items()
}
elif format == annotationlib.Format.SOURCE:
own = _convert_to_source(own_annotations)
own = annotationlib.annotations_to_source(own_annotations)
elif format in (annotationlib.Format.FORWARDREF, annotationlib.Format.VALUE):
own = own_checked_annotations
else:
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.