Created
September 23, 2018 10:21
-
-
Save ketanbhatt/41142ce95eddf53e02db59e510550bd2 to your computer and use it in GitHub Desktop.
Observer Pattern Blog: Code Snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NewsGetterMachine(object): | |
def __init__(self): | |
self.news = None | |
def get_news(): | |
return self.news | |
def news_flash(): | |
news = self.get_news() | |
news_paper_a.update(news) | |
news_paper_b.update(news) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment