Re: Element bug?(ElementTree)

2007-12-23 Thread Fredrik Lundh
limodou wrote:

 I don't know if it's a bug? Try below code:
 
   from elementtree.ElementTree import Element
   a = Element('a')
   if a:
  ... print ''
  ...
   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.

http://effbot.org/zone/element.htm#truth-testing

/F

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Element bug?(ElementTree)

2007-12-23 Thread limodou
On Dec 23, 2007 5:30 PM, Fredrik Lundh [EMAIL PROTECTED] wrote:
 limodou wrote:

  I don't know if it's a bug? Try below code:
 
from elementtree.ElementTree import Element
a = Element('a')
if a:
   ... print ''
   ...
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.

 http://effbot.org/zone/element.htm#truth-testing

 /F

Thanks. What I done just as that.

-- 
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
-- 
http://mail.python.org/mailman/listinfo/python-list


Element bug?(ElementTree)

2007-12-22 Thread limodou
I don't know if it's a bug? Try below code:

  from elementtree.ElementTree import Element
  a = Element('a')
  if a:
 ... print ''
 ...
  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
-- 
http://mail.python.org/mailman/listinfo/python-list