Hello everyone, Does anyone have experience here with elementree? Why does a valid node evaluate to False?
>>> type(n) <type 'Element'> >>> n <Element 'serial-number' at 0x7f7ecabad7e0> >>> bool(n) False >>> assert n Traceback (most recent call last): File "<console>", line 1, in <module> AssertionError >>> It's the same BTW for elementTree and the C implementation. Apparently (atleast with 2.6), the classes are still old-style. What's the special method to coerce an object into a boolean? Thanks -- ~noufal http://nibrahim.net.in _______________________________________________ BangPypers mailing list [email protected] http://mail.python.org/mailman/listinfo/bangpypers
