Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: Annotate angle parameter of page.rotate with int instead of float #1092

Merged
merged 1 commit into from
Jul 10, 2022
Merged
Changes from all commits
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
8 changes: 4 additions & 4 deletions PyPDF2/_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def createBlankPage(
deprecate_with_replacement("createBlankPage", "create_blank_page")
return PageObject.create_blank_page(pdf, width, height)

def rotate(self, angle: float) -> "PageObject":
def rotate(self, angle: int) -> "PageObject":
"""
Rotate a page clockwise by increments of 90 degrees.

Expand All @@ -314,11 +314,11 @@ def rotate(self, angle: float) -> "PageObject":
self[NameObject(PG.ROTATE)] = NumberObject(current_angle + angle)
return self

def rotate_clockwise(self, angle: float) -> "PageObject": # pragma: no cover
def rotate_clockwise(self, angle: int) -> "PageObject": # pragma: no cover
deprecate_with_replacement("rotate_clockwise", "rotate")
return self.rotate(angle)

def rotateClockwise(self, angle: float) -> "PageObject": # pragma: no cover
def rotateClockwise(self, angle: int) -> "PageObject": # pragma: no cover
"""
.. deprecated:: 1.28.0

Expand All @@ -327,7 +327,7 @@ def rotateClockwise(self, angle: float) -> "PageObject": # pragma: no cover
deprecate_with_replacement("rotateClockwise", "rotate")
return self.rotate(angle)

def rotateCounterClockwise(self, angle: float) -> "PageObject": # pragma: no cover
def rotateCounterClockwise(self, angle: int) -> "PageObject": # pragma: no cover
"""
.. deprecated:: 1.28.0

Expand Down