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

`Sprite.frect` is now supported as an alias of `Sprite.rect`

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

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

oddbookworm avatar Aug 04 '24 22:08 oddbookworm

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)

ankith26 avatar Aug 14 '24 19:08 ankith26

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

oddbookworm avatar Aug 16 '24 00:08 oddbookworm

I agree with Ankith here.

Starbuck5 avatar Aug 19 '24 06:08 Starbuck5

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.

JiffyRob avatar Aug 20 '24 00:08 JiffyRob

Yeah, thinking back on this, I agree with the opinions already here. Closing this pull request

oddbookworm avatar Oct 19 '24 01:10 oddbookworm