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

Sprite.frect is now supported as an alias of Sprite.rect #3033

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

oddbookworm
Copy link
Member

Also improves error messaging when something goes wrong in Group.draw

@oddbookworm oddbookworm added the sprite pygame.sprite label Aug 4, 2024
@oddbookworm oddbookworm requested a review from a team as a code owner August 4, 2024 22:46
@ankith26
Copy link
Member

In many places where pygame expects a "rect", an FRect is already acceptable. I don't see how adding an alias is very useful here if our goal is to promote the interchangeability/interuse of both (if this is a real word lol)

@oddbookworm
Copy link
Member Author

In many places where pygame expects a "rect", an FRect is already acceptable. I don't see how adding an alias is very useful here if our goal is to promote the interchangeability/interuse of both (if this is a real word lol)

I've seen several times that someone has tried to do self.frect = ... and expected it to work. I agree that on principle, everyone should just use .rect, but I also don't want to keep answering the same question over and over again about why self.frect doesn't work. Which is why I decided to go with an alias, but also make it such a small note in the docs that I hope almost nobody would ever know it's there

@Starbuck5
Copy link
Member

I agree with Ankith here.

@JiffyRob
Copy link
Contributor

If it's a common enough issue that it needs to be addressed automatically, why not print a warning when someone first uses it in their code?

Is it in the docs? If people don't read them then you're going to have to be dealing with them needing help a lot anyway.

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.

4 participants