| Issue 343: | Migrate from literal string event names to 'constant' variable event names | |
| 1 person starred this issue and may be notified of changes. | Back to list |
i.e., instead of:
animobj.connect('on_animation_complete', myhandler)
we do this:
from pymt.events import ON_ANIMATION_COMPLETE
animobj.connect(ON_ANIMATION_COMPLETE, myhandler)
And for backwards compatibility, in pymt/events.py:
ON_ANIMATION_COMPLETE = 'on_animation_complete'
Why all this? The interpreter will let us know immediately if we misspelled the event name, e.g. ON_ANIMATOIN_COMPLETE would immediately raise an error, but 'on_animatoin_complete' would only ever surface at runtime.
|