title: Python Try/Catch: simply go to next statement when Exception
body: <p>Lets say I have the following Python code:</p>
  
  <pre><code>x = some_product()
  name        = x.name
  first_child = x.child_list[0]
  link        = x.link
  id          = x.id
  </code></pre>
  
  <p>A problem might occur in line 3, when <strong>x.child_list</strong> is <strong>None</strong>. This obviously gives me a <strong>TypeError</strong>, saying that: </p>
  
  <pre><code>'NoneType' Object has no attribute '_____getitem_____'
  </code></pre>
  
  <p>What I want to do is, whenever <strong>x.child_list[0]</strong> gives a <strong>TypeError</strong>, simply ignore that line and go to the next line, which is "<strong>link = x.link</strong>"...</p>
  
  <p>So I'm guessing something like this:</p>
  
  <pre><code>try:
      x = some_product()
      name        = x.name
      first_child = x.child_list[0]
      link        = x.link
      id          = x.id
  Except TypeError:
      # Pass, Ignore the statement that gives exception..
  </code></pre>
  
  <p>What should I put under the Except block?
  Or is there some other way to do this?</p>
  
  <p>I know I can use <strong>If x.child_list is not None: ...</strong>, but my actual code is a lot more complicated, and I was wondering if there is a more pythonic way to do this</p>