Skip to content

Conversation

@aatle
Copy link
Member

@aatle aatle commented Jul 16, 2024

Make Group.has() return True instead of False when no sprites (empty list, no arguments, etc.) are given.

Closes #2993

This is potentially a breaking change. Might not get approved. See issue for discussion.

@aatle aatle requested a review from a team as a code owner July 16, 2024 01:23
@oddbookworm oddbookworm added the sprite pygame.sprite label Jul 16, 2024
@oddbookworm
Copy link
Member

Can you motivate this change with an example of when this change would actually matter? Offhand, I can't come up with a valid use-case where it should matter what this returns if no sprites are passed

@aatle
Copy link
Member Author

aatle commented Jul 16, 2024

Sure.
I'll post it in the issue.

@ankith26
Copy link
Member

I agree that this change is logical, but also, as pointed out before, it could be a backwards incompatible change that could break someones usage.

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.

I agree this makes sense, but I think this should wait for compatibility breaking release before being merged as the current behaviour has probably been around since the sprite group was created.

@ankith26 ankith26 marked this pull request as draft August 14, 2024 19:51
@ankith26
Copy link
Member

Thanks for the PR!

Essentially this PR has my approval as well, I'm just drafting it for now because it cannot be merged right now for reasons Myre stated.

@bilhox bilhox added this to the 3.0.0 milestone Oct 13, 2024
@aatle aatle added the bugfix PR that fixes bug label Aug 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR that fixes bug dont merge pygame-ce 3.0 sprite pygame.sprite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pygame.sprite.Group.has() method behavior for no sprites given

5 participants