pygame-ce
pygame-ce copied to clipboard
`Sprite.frect` is now supported as an alias of `Sprite.rect`
Also improves error messaging when something goes wrong in Group.draw
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)
In many places where pygame expects a "rect", an
FRectis 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
I agree with Ankith here.
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.
Yeah, thinking back on this, I agree with the opinions already here. Closing this pull request