Steven D'Aprano <[EMAIL PROTECTED]> wrote: >Anders wrote: >> "But then you decide to name the method "__nonzero__", instead of some >> nice descriptive name?"
> That suggests to me that Anders imagined that __nonzero__ is something I > just made up, instead of a standard Python method. What does it suggest > to you? That he thinks using __nonzero__ like this decreases readability. He also wrote > In comparison, I gather you would write something like this: > class C: > def __nonzero__(self): > return len(self.method()[self.attribute]) > -1 > ... > c = get_a_C() > if c: > ... If he had imagined that __nonzero__ was something you just made up, the second-last line there would have read if c.__nonzero__() -M- -- http://mail.python.org/mailman/listinfo/python-list