Skip to content

Commit

Permalink
Fix mypy types
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinThoma committed May 19, 2022
1 parent e9b73e6 commit 88b0368
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions PyPDF2/_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ def mergeScaledPage(
dimensions of the page to be merged.
"""
# CTM to scale : [ sx 0 0 sy 0 0 ]
self.mergeTransformedPage(page2, [scale, 0, 0, scale, 0, 0], expand)
self.mergeTransformedPage(page2, (scale, 0, 0, scale, 0, 0), expand)

def mergeRotatedPage(
self, page2: "PageObject", rotation: float, expand: bool = False
Expand All @@ -476,14 +476,14 @@ def mergeRotatedPage(
rotation = math.radians(rotation)
self.mergeTransformedPage(
page2,
[
(
math.cos(rotation),
math.sin(rotation),
-math.sin(rotation),
math.cos(rotation),
0,
0,
],
),
expand,
)

Expand All @@ -501,7 +501,7 @@ def mergeTranslatedPage(
:param bool expand: Whether the page should be expanded to fit the
dimensions of the page to be merged.
"""
self.mergeTransformedPage(page2, [1, 0, 0, 1, tx, ty], expand)
self.mergeTransformedPage(page2, (1, 0, 0, 1, tx, ty), expand)

def mergeRotatedTranslatedPage(
self,
Expand Down Expand Up @@ -615,7 +615,7 @@ def scale(self, sx: float, sy: float) -> None:
:param float sx: The scaling factor on horizontal axis.
:param float sy: The scaling factor on vertical axis.
"""
self.addTransformation([sx, 0, 0, sy, 0, 0])
self.addTransformation((sx, 0, 0, sy, 0, 0))
self.mediaBox = RectangleObject(
(
float(self.mediaBox.getLowerLeft_x()) * sx,
Expand Down
2 changes: 1 addition & 1 deletion PyPDF2/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def RC4_encrypt(key: Union[str, bytes], plaintext: bytes) -> bytes:
def matrixMultiply(
a: TransformationMatrixType, b: TransformationMatrixType
) -> TransformationMatrixType:
return tuple(
return tuple( # type: ignore[return-value]
tuple(sum(float(i) * float(j) for i, j in zip(row, col)) for col in zip(*b))
for row in a
)
Expand Down

0 comments on commit 88b0368

Please sign in to comment.