The example code from: http://sjbrown.ezide.com/games/example1.py.html
....
def Notify( self, event ):
if not isinstance(even t, 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(even t,TickEvent):.. .?
....
def Notify( self, event ):
if not isinstance(even t, 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(even t,TickEvent):.. .?
Comment