T
Tim Arnold
I have an XML snippet that I parse with ElementTree, and I get an element
called self.makeToc
Now this code:
print self.makeToc
if self.makeToc != None:
print 'here'
if self.makeToc: print 'but not here'
gives this result:
<Element toc at 40197e88>
here
Clearly self.makeToc has a value, so why isn't "if self.makeToc" True?
That is, if self.makeToc isn't None, why don't I get past 'if self.makeToc'
Can someone point out what am I not understanding?
thanks,
--Tim
called self.makeToc
Now this code:
print self.makeToc
if self.makeToc != None:
print 'here'
if self.makeToc: print 'but not here'
gives this result:
<Element toc at 40197e88>
here
Clearly self.makeToc has a value, so why isn't "if self.makeToc" True?
That is, if self.makeToc isn't None, why don't I get past 'if self.makeToc'
Can someone point out what am I not understanding?
thanks,
--Tim