On Tue, Dec 6, 2011 at 9:49 AM, Vikas BN <vikas...@gmail.com> wrote:
>    I'm working on a script to parse XML files and am using
> cElementTree for the same. However,
>    I was under the impression that anything that's a None type or 0 or
> "" would evaluate to False
>    and the rest would be True (incl an instance of an object).

Any object that has a __len__ defined will evaulate to False in a
boolean context if __len__ returns 0. (See also __nonzero__).

See section 5.1 here: http://docs.python.org/library/stdtypes.html

I hope this answers your question.
_______________________________________________
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers

Reply via email to