code: def iter(self):
          
          if self.patterns:
              patterns = list(self.patterns)
              for pattern in patterns:
                  yield pattern
docs: An iteration generator that allows the loop to modify the
          :class:`PatternSet` during the loop