yazdmich

Untitled

Sep 5th, 2014
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. class Event:
  2.     def __init__(self, observer, method):
  3.         self.observer = observer
  4.         self.method = method
  5.     def __call__(self, *args):
  6.         result = self.method(*args)
  7.         self.observer.notify(result)
  8.         return result
  9. class Observer:
  10.     def __init__(self, event):
  11.         self.event = event
  12.     def notify(self, *args)
  13.         pass
Advertisement
Add Comment
Please, Sign In to add comment