On Apr 30, 10:09 am, Joe Wreschnig <[email protected]> wrote:
> How about we keep scale as it is now but add scale_xy to set both at once?
I don't particularly like doing that. Sure it somehow beats calling a
property/_update_position twice. I don't like things like that
because:
- I can never remember prefix/infix/postfix rules for semantics/types
in some semi hungarian notation
- If applied consistently it would proliferate much of pyglets API
with countless postfix variations of the same function/attribute
- If not applied consistently, it's even harder to remember
- Imagine somebody new learning pyglet comes and asks why the heck
it's "sprite.scale = 1.0" and "sprite.scale_xy = 1.0, 2.0", and you
tell him, well, shucks, it's history.

> My view is that if someone is setting scale, they are likely setting
> it once, in which case speed matters not at all, or they are setting
> it every frame for some period of time likely measured in seconds to
> minutes, in which case it matters greatly.
I think the discussion about performance characteristics of argument
handling is pointless when you also call a _update_position every time
it changes, which in cost far outweighs pretty much whatever you do
with the arguments you get.

> I also remain unconvinced
> that typeswitching is a good idea at all, since it's not very Pythonic
I don't particularly like typeswitching either, but it is a tool one
can use when it fits the purpose.

> - who cares if it's a subclass of Python's definition of a number,
> when what we really care is that you can multiply it by a number and
> get a number out?
That'd imply catching an exception, which actually *is* really
expensive (in the error case)

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en.

Reply via email to