import xml.etree.ElementTree as ET e = ET.Element(\'Brock\',Role=\"Bodyguard\") print bool(e)
Why is an xml.etree.ElementTree.Element
xml.etree.ElementTree.Element
From the docs:
http://docs.python.org/library/xml.etree.elementtree.html#element-objects
Caution: Elements with no subelements will test as False. This behavior will change in future versions. Use specific len(elem) or elem is None test instead.