I am using elementtree and was wondering why an Element evaluates to False:
import xml.etree.ElementTree as ET
elt = ET.Element('foo')
if elt:
print('bar')
I would expect "bar" to be printed because I have a valid Element, but it is not. Is there a reason for this behaviour?