Python, Passing a list to a method in order to iterate yields argument of type instance not iterable?
<p><strong>Method to check if a pkg name is already inside another list thats populated with structures:</strong>    </p>

<p><strong>For example</strong>: test_pkg_list[] would contain something along the following:</p>

<pre><code>test_pkg_list[0]: 

name = git
version = 1.0
description = git package

test_pkg_list[1]:

name = opengl
version = 1.25
description = graphics

So on...
</code></pre>

<p>So my goal was to check the list for any duplicates of names.</p>

<pre><code>def _pkg_exists_in_list(self, list, pkg_name):
        if len(list) &gt;= 1:
            if any(pkg_name in item for item in list):
                return True 
            else:
                return False
        else:
            return False
</code></pre>

<p><strong>I pass in two parameters:</strong></p>

<pre><code>test_pkg_list = [] #Note that this list does populate over time, at first its empty.
pkg_name = 'git'

#Call the method an pass the paramters
if self._pkg_exists_in_list(test_pkg_list, pkg_name) is False:
  #No duplicates found continue
else:
  #We found duplicate, stop.
</code></pre>

<p><strong>I continue to receive the following exception error:</strong></p>

<pre><code>argument of type 'instance' is not iterable
</code></pre>
