Skip to content

Commit

Permalink
MAINT: Update comment
Browse files Browse the repository at this point in the history
Recursive types like the following are now supported by mypy:

OutlineType = List[Union[Destination, "OutlineType"]]

However, this recursuve type does not work with the Sphinx documentation generator; update comment to reflect this.
  • Loading branch information
j-t-1 authored Mar 5, 2025
1 parent b7fd19a commit 9b36297
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pypdf/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
ZoomArgType: TypeAlias = Union[NumberObject, NullObject, float]
ZoomArgsType: TypeAlias = List[ZoomArgType]

OutlineType: TypeAlias = List[Union[Destination, "OutlineType"]]
# Recursive types like the following are not yet supported by Sphinx:
# OutlineType = List[Union[Destination, "OutlineType"]]
# Hence use this for the moment:
OutlineType = List[Union[Destination, List[Union[Destination, List[Destination]]]]]

LayoutType: TypeAlias = Literal[
"/NoLayout",
Expand Down

0 comments on commit 9b36297

Please sign in to comment.