title: Assertion not valid in script though type comparison works in terminal
body: <p>I encounter a quite strange issue with comparison.</p>
  
  <p>I want to decode python script arguments, store them and analyse them. In the following command, the -r option shall be used to determine which type of report to create.</p>
  
  <p>python script launching :
  <code>%run decodage_parametres_script.py -r junit,html</code>     </p>
  
  <p>python script options parsing is used to fill a dictionary, the result is:
  current_options :</p>
  
  <p><code>{'-cli-no-summary': False, '-cli-silent': False, '-r': ['junit', 'html']}</code></p>
  
  <p>Then I want to test the -r options, here is the code:</p>
  
  <pre><code>for i in current_options['-r']:
      # for each reporter required with the -r option:
      #    - check that a file path has been configured (otherwise set default)
      #    - create the file and initialize fields
      print("trace i", i)
      print("trace current_options['-r'] = ", current_options['-r'])
      print("trace current_options['-r'][0] = ", current_options['-r'][0])
  
      if current_options['-r'][i] == 'junit':
          # request for a xml report file
          print("request xml export")
          try:
              xml_file_path = current_option['--reporter-junit-export']
              print("xml file path = ", xml_file_path)
          except:
              # missing file configuration
              print("xml option - missing file path information")
              timestamp = get_timestamp()
              xml_file_path = 'default_report' + '_' + timestamp + '.xml'
              print("xml file path = ", xml_file_path)
          if xml_file_path is not None:
              touch(xml_file_path)
              print("xml file path = ", xml_file_path)
          else:
              print('ERROR: Empty --reporter-junit-export path')
              sys.exit(0)
      else:
          print("no xml file required")    
  </code></pre>
  
  <p>I want to try the default report generation but I don't even hit the print("request xml export") line, here is the console result :</p>
  
  <pre><code>trace i junit
  trace current_options['-r'] =  ['junit', 'html']
  trace current_options['-r'][0] =  junit
  </code></pre>
  
  <p>As I guess it could be a type issue, I tried the following tests:</p>
  
  <pre><code>In [557]: for i in current_options['-r']:
   ...:     print(i, type(i))
   ...:
  junit &lt;class 'str'&gt;
  html &lt;class 'str'&gt;
  
  In [558]: toto = 'junit'
  
  In [559]: type(toto)
  Out[559]: str
  
  In [560]: toto
  Out[560]: 'junit'
  
  In [561]: toto == current_options['-r'][0]
  Out[561]: True
  </code></pre>
  
  <p>so my line assertion <code>if current_options['-r'][i] == 'junit'</code>: should end up begin True but it's not the case.
  Am I missing something trivial ???  :(</p>
  
  <p>Can someone help me, please ?</p>