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

Add typing support for collide_mask as collided argument in spritecollide #2569

Merged
merged 3 commits into from
Nov 18, 2023

Conversation

ZeroWave022
Copy link
Contributor

This PR attempts to fix #2568 by making the type of the collided argument of pygame.sprite.spritecollide, pygame.sprite.spritecollideany and pygame.sprite.groupcollide more strict/precise.
It also adds the pygame.sprite.collide_mask return type as one of the possible return types besides a boolean.

@ZeroWave022 ZeroWave022 requested a review from a team as a code owner November 15, 2023 19:43
@yunline yunline added the sprite pygame.sprite label Nov 16, 2023
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.

Thanks for the PR! 🥳

left a few reviews

buildconfig/stubs/pygame/sprite.pyi Outdated Show resolved Hide resolved
buildconfig/stubs/pygame/sprite.pyi Outdated 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.

This PR is almost ready to go, approving but leaving a minor review for your consideration. Thanks again! 🍰

buildconfig/stubs/pygame/sprite.pyi Show resolved Hide resolved
Copy link
Member

@MyreMylar MyreMylar left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@MyreMylar MyreMylar merged commit 9e2f4b3 into pygame-community:main Nov 18, 2023
28 checks passed
@itzpr3d4t0r itzpr3d4t0r added this to the 2.4.0 milestone Nov 18, 2023
@ankith26 ankith26 changed the title Support collide_mask as collided argument in spritecollide Add typing support for collide_mask as collided argument in spritecollide Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sprite pygame.sprite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pygame.sprite.spritecollide collided argument typing incompatible with collide_mask
5 participants