title: Check if xml ElementTree node is None/False
body: <p>Is it safe to check whether a variable <code>myvar</code> has not-None value by simply:</p>
  
  <pre><code>if myvar:
      print('Not None detected')
  </code></pre>
  
  <p>I'm asking this because I have a variable and was checking whether the variable was not <code>None</code> by simply <code>if variable:</code> but the check has been failing. The variable contains some data but it was evaluating to False in the <code>if</code> check.</p>
  
  <p><strong>Full Code:</strong></p>
  
  <pre><code>from xml.etree import ElementTree as ElementTree
  
  root = ElementTree.fromstring('Some xml string')
  
  parameters = root.find('Some Tag')
  
  udh = parameters.find('UDH')
  
  if udh and udh.text:  # In this line the check is failing, though the udh variable has value: &lt;Element 'UDH' at 0x7ff614337208&gt;
      udh = udh.text
      # Other code
  else:
      print('No UDH!')  # Getting this output
  </code></pre>