def __iter__(self):
        if self.iterate:
            self.iterate = False
            return super(BadList, self).__iter__()
        raise RuntimeError("Something bad happened")
Allow normal list iteration, or raise an exception.
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/python/test/test_sendmsg.py/BadList.__iter__