title: 'return' with not-None expression list returns 'None'
body: <p>I'm currently working on XML (SVG) traversing and have the next problem:<br>
  my function always return None after <code>if currNode.parentNode is rootNode:</code>, though, as you can see in the code below, I've explicitly set return to 'flag', which is non-empty string.<br>
  The most interesting part here is that <code>print('...')</code> prints three dots, so the problem is exactly there (or at least looks like that).</p>
  
  <p>According to the Python docs: 'If an expression list is present, it is evaluated, else None is substituted.'  </p>
  
  <p>So, in short, the question is:<br>
  why 'return' doesn't returns 'flag' string, but 'None' instead?</p>
  
  <p>Here's this piece of code:
  <code><pre>
  def relsLookup(currNode, rootNode):
      if currNode.nextSibling is not None:
          currNode = currNode.nextSibling
          return currNode
      elif currNode.nextSibling is None:
          if currNode.parentNode is rootNode:
              flag = 's2s_exception_end_of_svg'
              print('...')
              return flag
          elif currNode.parentNode.localName == 'g':
              if currNode.parentNode.nextSibling is not None:
                  print('&lt;--')
                  currNode = currNode.parentNode.nextSibling
                  return currNode
              elif currNode.parentNode.nextSibling is None:
                  print('&lt;--')
                  currNode = currNode.parentNode
                  relsLookup(currNode, rootNode)
          else:
              flag = 's2s_exception_unknown_parent'
              return flag
      else:
          flag = 's2s_exception_unknown_sibling'
          return flag
  </pre></code></p>