title: Python 3.6 empty dict changing into TextIOWrapper after reading file
body: <p>I've declared an empty dict to later fill with a list of tuples containing stock market data and for the life of me I cant figure out why the 'dict' changes into a 'TextIOWrapper' when I get around to assigning the list</p>
  
  <p>This is my code:</p>
  
  <pre><code>months = ('jan', 'feb', 'mar', 'apr', 'may', 'jun',
            'jul', 'aug', 'sep', 'oct', 'nov', 'dec')
  path = os.getcwd()
  ohlc_path = os.path.join(path, 'ohlc')
  
  data = dict()
  print('data type: %s' % type(data))
  ctr = 0
  for m in months:
      filepath = os.path.join(ohlc_path, 'BANKNIFTY' + m + '.txt')
      temp = list()
      with open(filepath, 'r') as data:
          for line in data:
              ctr += 1
              raw = (line.strip().split(','))
              ts = datetime.strptime(raw[1] + '-' + raw[2], '%Y%m%d-%H:%M')
              fin = (str(raw[0]), ts, float(raw[3]),
                     float(raw[4]), float(raw[5]), float(raw[6]))
              temp.append(fin)
      print(m)
      print(temp[0])
      print('data type: %s' % type(dict))
      data.append(temp)
  </code></pre>
  
  <p>Output I'm getting:</p>
  
  <pre><code>data type: &lt;class 'dict'&gt;
  jan
  ('BANKNIFTY', datetime.datetime(2017, 1, 2, 9, 8), 18242.3, 18242.3, 18242.3, 18242.3)
  data type: &lt;class 'type'&gt;
  Traceback (most recent call last):
    File "backtest.py", line 28, in &lt;module&gt;
      data.append(temp)
  AttributeError: '_io.TextIOWrapper' object has no attribute 'append'
  </code></pre>