title: Cannot iterate a list type in python 3
body: <p>Problem:</p>
  <p><code>root.children</code>(named in following code) is a <code>list</code> type, but I still cannot iterate each item, does anyone know the reason? Thanks!</p>
  <p>My code:</p>
  <pre><code>class Node():
      def __init__(self, value) -&gt; object:
          self.value = value
          self.children = []
      def __repr__(self, level=0):
          ret = &quot;\t&quot;*level+repr(self.value)+&quot;\n&quot;
          for child in self.children:
              ret += child.__repr__(level+1)
          return ret
      def add_child(self, node):
          self.children.append(node)
      def __iter__(self):
          return iter(self.children)
      
  
  list_1 = ['Lisa', 'apple', 'banana']   #, 'orange', 'Kiwi'
  root = parent = Node(list_1[0])
  i=1
  while i &lt; len(list_1):
      current_node = Node(list_1[i])
      parent.add_child(current_node)
      parent = current_node
      j=0
      while j &lt; len(root.children): # root.children is a list type, but I still cannot iterate each item in the list
          print('YES')
          j+=1
      i+=1
  print(root)
  </code></pre>
  <p>Undesired output:</p>
  <pre><code>YES
  YES
  'Lisa'
      'apple'
          'banana'
  
  </code></pre>
  <p>Desired output:</p>
  <pre><code>YES
  YES
  YES
  YES
  YES
  'Lisa'
      'apple'
          'banana'
  </code></pre>
  <p>My purpose, is actually to search through all items in the current 'root.children', if my target item has already existed in the 'root.children', then I will 'do something'.</p>