title: error Iterating through OrderedDict in Python 3.4
body: <p>I am trying to iterate through an OrderedDict using {Key, Value} but i am running into Key Error. The iteritems() was deprecated in python 3.4 that i am using and now i have to use items() to do the same thing </p>
  
  <pre><code> File "/home/hotdogs/mydictset.py", line 88, in __init__
   self.mainParams[k]['start'], self.mainParams[k]['step'], self.mainParams[k] ['stop'])
   KeyError: 'timed_exit_bars'
  
  
  class MySet()
    def __init__(self, filePath):
      # Read diagnostics set file
      self.content = readSetFile(filePath)
      if not self.content: return
      self.sections = self.content._sections
      self.mainParams = {}
      self.optimizationArray = {}
      global paramIndexes
  
      #for k, v in OrderedDict(self.content.items('main')).iteritems(): --was from python 2.7 and i have removed it.
  
      for k, v in OrderedDict(self.content.items('main')).items():
          # Add the params names avoiding the optimization line
          if k.find(",") == -1:
              # Adding name of the param and the value
              if k not in self.mainParams:
                  self.mainParams[k] = {}
              self.mainParams[k]['value'] = v
              # optimization flags
              if self.content.has_option('main', k + ',F'):
                  if self.content.getboolean('main', k + ',F') == 1:
                      self.mainParams[k]['optimize'] = True
                      self.mainParams[k]['start'] = self.content.getfloat('main', k + ',1')
                      self.mainParams[k]['step'] = self.content.getfloat('main', k + ',2')
                      self.mainParams[k]['stop'] = self.content.getfloat('main', k + ',3')
                      self.optimizationArray[paramIndexes[k]] = (
                      self.mainParams[k]['start'], self.mainParams[k]['step'], self.mainParams[k]['stop'])
                  else:
                      self.mainParams[k]['optimize'] = False
              else:
                  self.mainParams[k]['optimize'] = False
  
      i = 0
  </code></pre>
  
  <p>When i try to debug the Key error . i see that the mainParams contains just an ordinary unsorted dict and the parameters themselves are also ordinary dict themselves from the debug below . Sample is below </p>
  
  <pre><code>  {'section_1': {'value': '################# General Settings #################', 'optimize': False}, 
    'run_every_tick': {'value': '0', 'optimize': False}, 
    'historic_data_id': {'value': '1', 'optimize': False}, 
    'section_2': {'value': '############## Common Strategy Settings ##############','optimize': False}, 
    'use_instance_balance': {'value': '0', 'optimize': False}, 
    'comments': {'value': 'Click Modify expert to view comments inside the source code.', 'optimize': False}, 
    'operational_mode': {'value': '1', 'optimize': False}, 
    'instance_management': {'value': '0', 'optimize': False}, 
    'analysis_window_size': {'value': '0', 'optimize': False}, 
    'enable_screenshots': {'value': '0', 'optimize': False}, 
    'timed_exit_bars': {'step': 5.0, 'start': 5.0, 'value': '60', 'stop': 100.0, 'optimize': True}, 
    'max_open_orders': {'value': '1', 'optimize': False}, 
    'strategy_timeframe': {'value': '60', 'optimize': False}, 
    'ui_font_size': {'value': '12', 'optimize': False},  
    'disable_compounding': {'value': '1', 'optimize': False}}
  </code></pre>
  
  <p>Below is a sample of what i get through Debug for ParamIndexes</p>
  
  <pre><code>{
  'INTERNAL_STRATEGY_ID': 52, 
  'RUN_EVERY_TICK': 43, 
  'MAX_OPEN_ORDERS': 45, 
  'OPERATIONAL_MODE': 50, 
  'ANALYSIS_WINDOW_SIZE': 55, 
  'TIMEFRAME': 53, 
  'DISABLE_COMPOUNDING': 47,
  'INSTANCE_MANAGEMENT': 44, 
  'MAX_SPREAD': 59, 
  'TIMED_EXIT_BARS': 48, 
  'STRATEGY_INSTANCE_ID': 51, 
  ...
  ...
  ....
  ....
  ....
  ....
  ....
  ....
  ....
  ....
  }
  </code></pre>
  
  <p>Is there something i am missing. I can't seem to get it working with items() to iterate through the Dictionary. Any help is well appreciated.</p>