pygame-ce icon indicating copy to clipboard operation
pygame-ce copied to clipboard

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

Open aatle opened this issue 1 year ago • 4 comments
trafficstars

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 avatar Jul 16 '24 01:07 aatle

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

oddbookworm avatar Jul 16 '24 03:07 oddbookworm

Sure. I'll post it in the issue.

aatle avatar Jul 16 '24 03:07 aatle

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.

ankith26 avatar Jul 21 '24 18:07 ankith26

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.

ankith26 avatar Aug 14 '24 19:08 ankith26