Issue 344 in pymt: Migrate from literal string event names to 'constant' variable event names

0 views
Skip to first unread message

py...@googlecode.com

unread,
Oct 12, 2010, 6:59:46 AM10/12/10
to pymt-...@googlegroups.com
Status: Accepted
Owner: dennda85
Labels: Type-Defect Priority-Medium

New issue 344 by dennda85: Migrate from literal string event names
to 'constant' variable event names
http://code.google.com/p/pymt/issues/detail?id=344

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.

Reply all
Reply to author
Forward
0 new messages