What does "TypeError: [foo] object is not callable" mean?
<p>I am trying to iterate through a list of Facebook postIDs, and I am getting the following error:</p>

<p>TypeError: 'list' object is not callable</p>

<p>Here is my code:</p>

<pre><code>MCTOT_postIDs = [["126693553344_10155053097028345"],
["126693553344_10155050947628345"],
["126693553344_10155048566893345"],
["126693553344_10155044677673345"],
["126693553344_10155042089618345"],
["126693553344_10155035937853345"],
["126693553344_10155023046098345"]]

g = facebook.GraphAPI()
g.access_token = g.get_app_access_token(APP_ID, APP_SECRET)

for x in MCTOT_postIDs():
g.get_object('fields="message, likes, shares')
</code></pre>

<p>I know I am making a basic error somewhere, but I can't seem to figure it out.  Thanks!</p>

<p>EDIT: 
For the other error, the function g.get_object(...) requires one more argument, that you are not passing.
You're passing the fields, but you're must pass an ID as an argument too, you must pass the x of your loop, that contains the id.</p>

<p>Probably should go like:</p>

<pre><code>g.get_object('fields="message, likes, shares', x)
</code></pre>

<p>or maybe </p>

<pre><code>g.get_object('fields="message, likes, shares', x[0]) 
</code></pre>

<p>if you need to pass it as a string, not an array (your list is a list of arrays)
but this should be a topic for a new question...</p>

<hr>

<p>The error message says:</p>

<pre><code>TypeError: 'list' object is not callable
</code></pre>

<p>So look again at your code: when you try to do the for ... in loop, you're trying to call your list, as if it was a function.</p>

<p>You're doing</p>

<pre><code>for x in MCTOT_postIDs():
</code></pre>

<p>When you should be doing</p>

<pre><code>for x in MCTOT_postIDs:
</code></pre>

<p>The list is not callable, and the () is used for calling a function (meaning: execute the function). Remove it and it should work.</p>

python