design pattern quick reference if __name__ ="__main__"my_list mylist( my_iterator my_list getiterator(while my_iterator has_next()print(my_iterator next()alternative iterator_alt py for element in collectiondo_something(elementobserver observer py class concreteobserver(object)def update(selfobserved)print("observing{}format(observed)class observable(object)def __init__(self)self callbacks set(self changed false def register(selfcallback)self callbacks add(callbackdef unregister(selfcallback)self callbacks discard(callbackdef unregister_all(self)self callbacks set(