title: Python 2.7x generators to return indexes of "False"s in a Boolean list
body: <p>I'm trying to write a function to return the indexes of the 'False' values in an arbitrary list. I also would like to use generators for this.</p>
  
  <p>I wrote below:</p>
  
  <pre><code>def cursor(booleanList):
    for element in booleanList:
      if element is False:
        yield booleanList.index(element)
  </code></pre>
  
  <p>So for example I have the list below</p>
  
  <pre><code>testList = [True, False, True, False]
  </code></pre>
  
  <p>And then:</p>
  
  <pre><code>g = cursor(testList)
  </code></pre>
  
  <p>However if I use my code, I would get:</p>
  
  <pre><code>&gt; g.next()
  1
  &gt; g.next()
  1
  &gt; g.next()
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  StopIteration
  </code></pre>
  
  <p>Whereas I expect to get:</p>
  
  <pre><code>&gt; g.next()
  1
  &gt; g.next()
  3
  &gt; g.next()
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  StopIteration
  </code></pre>
  
  <p>Where's the problem in the code? Any help would be much appreciated.</p>