title: if clause in list comprehension gives undefined name error in pdb but not in interpreter
body: <p>Sorry for the terrible title. I had to figure out the terminology and an trying to put all relevant points there. </p>
  
  <p>Consider the following simple interaction in Python:</p>
  
  <pre><code>Python 3.6.9 (default, Jul 21 2019, 14:33:59) 
  [GCC 7.4.0] on cygwin
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; python.el: native completion setup loaded
  &gt;&gt;&gt; s1 = [ i for i in range(10)]
  &gt;&gt;&gt; [i for i in range(len(s1)) if s1[i]%2 == 0]
  [0, 2, 4, 6, 8]
  </code></pre>
  
  <p>The last statement creates (and prints) indexes of the even elements in the original array s1. </p>
  
  <p>But the equivalent does not work in pdb:</p>
  
  <pre><code>(Pdb) !s1 = [ i for i in range(10)]
  (Pdb) s1
  [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
  (Pdb) ![i for i in range(len(s1)) if s1[i]%2 == 0]
  *** NameError: name 's1' is not defined
  </code></pre>
  
  <p>Why is s1 in scope in python interpreter but not in debugger? I am trying to identify elements in the array that meet certain criteria. What is the python way to do this in debugger?</p>