A list which cannot be iterated sometimes.

This is a list subclass to get past the type check in send1msg, not as an example of how real programs might want to interact with send1msg (or anything else). A custom list subclass makes it easier to trigger certain error cases in the implementation.

Instance Variable iterate A flag which indicates whether an instance of BadList will allow iteration over itself or not. If False, an attempt to iterate over the instance will raise an exception.
Method __iter__ Allow normal list iteration, or raise an exception.
iterate =
A flag which indicates whether an instance of BadList will allow iteration over itself or not. If False, an attempt to iterate over the instance will raise an exception.
def __iter__(self):

Allow normal list iteration, or raise an exception.

If self.iterate is True, it will be flipped to False and then normal iteration will proceed. If self.iterate is False, RuntimeError is raised instead.

API Documentation for twisted, generated by pydoctor at 2020-03-25 17:34:30.