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

Improved Rect and FRect typing to be more generic and accurate #2297

Merged
merged 11 commits into from
Jul 13, 2023

Conversation

oddbookworm
Copy link
Member

@oddbookworm oddbookworm commented Jul 8, 2023

dickerdackel (Discord) pointed out that rect positioning properties have lint problems with anything except a tuple, but the code accepts more. So, this PR is to fix that issue for both Rect and FRect. I also updated size

Edit: this has become more of an "all-around improvement of rect typestubs"

@oddbookworm oddbookworm requested a review from a team as a code owner July 8, 2023 15:33
Copy link
Member

@ankith26 ankith26 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the PR 🍰

@ankith26 ankith26 added the type hints Type hint checking related tasks label Jul 9, 2023
buildconfig/stubs/pygame/rect.pyi Outdated Show resolved Hide resolved
@oddbookworm oddbookworm changed the title Fixed Rect and FRect typing to use setters and getters Improved Rect and FRect typing to be more generic and accurate Jul 9, 2023
buildconfig/stubs/pygame/rect.pyi Show resolved Hide resolved
buildconfig/stubs/pygame/rect.pyi Outdated Show resolved Hide resolved
buildconfig/stubs/pygame/rect.pyi Show resolved Hide resolved
Copy link
Member

@ankith26 ankith26 left a comment

Choose a reason for hiding this comment

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

I like how this PR started with one area improvement and quickly spiralled into all round general improvements.
Thanks a lot! 😎

PS to the person merging this: Please squash and merge this PR

Copy link
Member

@zoldalma999 zoldalma999 left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks!

@zoldalma999 zoldalma999 merged commit 1f48a95 into pygame-community:main Jul 13, 2023
27 checks passed
@zoldalma999 zoldalma999 added this to the 2.3.1 milestone Jul 13, 2023
@zoldalma999 zoldalma999 added Code quality/robustness Code quality and resilience to changes rect pygame.rect labels Jul 13, 2023
@oddbookworm oddbookworm deleted the rect_setters_getters branch December 21, 2023 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code quality/robustness Code quality and resilience to changes rect pygame.rect type hints Type hint checking related tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants