Including If In Arrays Formed Using For
<p>In Python I have this statement:</p>

<pre><code>blog_ids = [c.blog_id for c in connections]
</code></pre>

<p>Which basically tells Python to create an array of all the blog IDs in the connections. Unfortunately, if the <code>connections</code> object has some <code>None</code> types, <code>c.blog_id</code> would cause an exception. Is there any syntax to solve this problem? I tried this but it doesn't work:</p>

<pre><code>blog_ids = [c.blog_id for c not None in connections]
</code></pre>
