title: Read and parsing file content in python
body: <p>I have a file which contain entries in the following format:</p>
  
  <pre><code>FID=COST|Tolerance=1
  
  FID=(BUY,SELL)|Tolerance=0
  
  FID=[(X,Y),(A,B)]|Tolerance=0
  </code></pre>
  
  <p>What would be the best way to find out if <code>FID</code> is a string, tuple or list while reading the file?</p>
  
  <p>A normal <code>isinstance</code> test of the value of FID immediately after reading wont work. Appreciate any help.</p>