class DepthFirstSearchStrategy:

    def __init__(self, content, max_depth):
        self.content = content
        self.max_depth = max_depth

    def __iter__(self):
        return self

    def __next__(self):
        try:
            global_state = self.content.pop(0)
            if global_state.mstate.depth >= self.max_depth:
                return self.__next__()
            return global_state
        except IndexError:
            raise StopIteration()



class DepthFirstSearchStrategy:
    """
    Implements a depth first search strategy
    I.E. Follow one path to a leaf, and then continue to the next one
    """
    def __init__(self, work_list, max_depth):
        self.work_list = work_list
        self.max_depth = max_depth

    def __iter__(self):
        return self

    def __next__(self):
        """ Picks the next state to execute """
        try:
            # This strategies assumes that new states are appended at the end of the work_list
            # By taking the last element we effectively pick the "newest" states, which amounts to dfs
            global_state = self.work_list.pop()
            if global_state.mstate.depth >= self.max_depth:
                return self.__next__()
            return global_state
        except IndexError:
            raise StopIteration()


Add documentation and fix pop
Add documentation and fix pop

+ 
+ 
  class DepthFirstSearchStrategy:
- 
+     """
+     Implements a depth first search strategy
+     I.E. Follow one path to a leaf, and then continue to the next one
+     """
-     def __init__(self, content, max_depth):
+     def __init__(self, work_list, max_depth):
-         self.content = content
+         self.work_list = work_list
          self.max_depth = max_depth
  
      def __iter__(self):
          return self
  
      def __next__(self):
+         """ Picks the next state to execute """
          try:
+             # This strategies assumes that new states are appended at the end of the work_list
+             # By taking the last element we effectively pick the "newest" states, which amounts to dfs
-             global_state = self.content.pop(0)
+             global_state = self.work_list.pop()
              if global_state.mstate.depth >= self.max_depth:
                  return self.__next__()
              return global_state
          except IndexError:
              raise StopIteration()
  
+ 
Add documentation and fix pop
## Code Before:
class DepthFirstSearchStrategy:

    def __init__(self, content, max_depth):
        self.content = content
        self.max_depth = max_depth

    def __iter__(self):
        return self

    def __next__(self):
        try:
            global_state = self.content.pop(0)
            if global_state.mstate.depth >= self.max_depth:
                return self.__next__()
            return global_state
        except IndexError:
            raise StopIteration()

## Instruction:
Add documentation and fix pop
## Code After:


class DepthFirstSearchStrategy:
    """
    Implements a depth first search strategy
    I.E. Follow one path to a leaf, and then continue to the next one
    """
    def __init__(self, work_list, max_depth):
        self.work_list = work_list
        self.max_depth = max_depth

    def __iter__(self):
        return self

    def __next__(self):
        """ Picks the next state to execute """
        try:
            # This strategies assumes that new states are appended at the end of the work_list
            # By taking the last element we effectively pick the "newest" states, which amounts to dfs
            global_state = self.work_list.pop()
            if global_state.mstate.depth >= self.max_depth:
                return self.__next__()
            return global_state
        except IndexError:
            raise StopIteration()

