How the event list be sent to EventManager?

steve hxianping at gmail.com
Thu Oct 26 02:29:01 EDT 2006


The example code from: http://sjbrown.ezide.com/games/example1.py.html
...
def Notify( self, event ):
                if not isinstance(event, TickEvent): Debug( "
Message: " + event.name )
                for listener in self.listeners.keys():
                        #If the weakref has died, remove it and
continue
                        #through the list
                        if listener is None:
                                del self.listeners[ listener ]
                                continue
                        listener.Notify( event )

I can not figure out how 'event' can has reference to 'event.name'?
Anyhow the 'event' has not defined!
The 'event' dynamically get its own type through
isinstance(event,TickEvent):...?




More information about the Python-list mailing list