[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Philosophical Question On Naming



self.rect is already used by the pygame.sprite.Sprite class.

On 4/24/07, Samuel Mankins <waterflight@xxxxxxxxxxxxx > wrote:
I agree with Jason. Also, self.rect is the predefined value for where
the widget is, I believe.

--Skizzaltix

Jason Massey wrote:
> Don't you think that the "explicit is better than implicit" in import
> this gives you some help?
>
> I'd stick with the self.location
>
>
>
> On 4/23/07, * Kris Schnee* <kschnee@xxxxxxxxxx
> <mailto:kschnee@xxxxxxxxxx>> wrote:
>
>     A trivial question that's bugging me:
>
>     A Widget object currently has a variable called "location," which is a
>     Pygame.Rect object. It _is_ a Rect, but what it _means_ is the
>     Widget's
>     location. Is it better to call it " self.location" or "self.rect"?
>
>     Even typing "import this" at the IDLE console gives no clear insight.
>
>     Kris
>
>