design pattern quick reference iterator classic_iterator py import abc class iterator(metaclass=abc abcmeta)@abc abstractmethod def has_next(self)pass @abc abstractmethod def next(self)pass class container(metaclass=abc abcmeta)@abc abstractmethod def getiterator(self)pass class mylistiterator(iterator)def __init__(selfmy_list)self index self list my_list list def has_next(self)return self index len(self listdef next(self)self index + return self list[self index class mylist(container)def __init__(self*args)self list list(argsdef getiterator(self)return mylistiterator(self