title: Python - List - unable to detect size
body: <p>I have a function which is aimed to parse a text file, found a regex match (ip + port) and return a list with unique value:</p>
  
  <pre><code>def parser (file):
      ip_list = []
      pattern = re.compile('[0-9]+(?:\.[0-9]+){3}.port.*')
      for i, line in enumerate(open(file)):
          for match in re.finditer(pattern, line):
              ip_list.append(match.group())
      unique_ip = reduce(lambda l, x: l if x in l else l+[x], ip_list,[])
      return [unique_ip]
  </code></pre>
  
  <p>This works pretty fine, but for some reason I'm unable to iterate on returned list object and get current size.
  Example, if I print out </p>
  
  <pre><code>print(parser(file))
  </code></pre>
  
  <p>and I obtain this output:</p>
  
  <pre><code>[['212.162.82.10 port 80', '212.162.81.10 port 8081']]
  </code></pre>
  
  <p>I get a list size of 1 (despite there's 2 elements):</p>
  
  <pre><code>print(len(parser(file)))
  1
  </code></pre>
  
  <p>I'm not getting where I'm making mistake.
  thx</p>