By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,908 Members | 2,055 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,908 IT Pros & Developers. It's quick & easy.

Element bug?(ElementTree)

P: n/a
I don't know if it's a bug? Try below code:
>>from elementtree.ElementTree import Element
a = Element('a')
if a:
... print 'hhhh'
...
>>a.__len__()
0

You can see if I test a, the result will be False. I don't know if
it's an expected result, but this thing has beaten me some times.

--
I like python!
UliPad <<The Python Editor>>: http://code.google.com/p/ulipad/
meide <<wxPython UI module>>: http://code.google.com/p/meide/
My Blog: http://www.donews.net/limodou
Dec 23 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.