Skip to content

DEV: Refine type annotation for Page.rotate#1021

Closed
SXHRYU wants to merge 1 commit intopy-pdf:mainfrom
SXHRYU:patch-1
Closed

DEV: Refine type annotation for Page.rotate#1021
SXHRYU wants to merge 1 commit intopy-pdf:mainfrom
SXHRYU:patch-1

Conversation

@SXHRYU
Copy link
Copy Markdown
Contributor

@SXHRYU SXHRYU commented Jun 23, 2022

Increments of 90 cannot be float. You can, of course, put angle=180.0, but this looks anti-pythonic.

Increments of 90 cannot be float. You can, of course, put `angle=180.0`, but this looks anti-pythonic.
return PageObject.create_blank_page(pdf, width, height)

def rotate(self, angle: float) -> "PageObject":
def rotate(self, angle: int) -> "PageObject":
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll want to apply this change to the deprecated rotate_clockwise, rotateClockwise, and rotateCounterClockwise function signatures so that mypy is happy.

@MartinThoma MartinThoma changed the title fix type hinting DEV: Refine type annotation for Page.rotate Jun 23, 2022
@MartinThoma MartinThoma added the needs-rebase This PR cannot be merged as the main branch is too different. You need to rebase or merge main. label Jun 26, 2022
@MartinThoma
Copy link
Copy Markdown
Member

@SXHRYU Thank you for the PR! Have you seen the comment by @MasterOdin ? Do you need help with that?

MartinThoma added a commit that referenced this pull request Jul 10, 2022
Closes #1021

Co-authored-by: probel_hero <93727145+SXHRYU@users.noreply.github.com>
MartinThoma added a commit that referenced this pull request Jul 10, 2022
Closes #1021

Co-authored-by: probel_hero <93727145+SXHRYU@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase This PR cannot be merged as the main branch is too different. You need to rebase or merge main.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants