On 6 July 2010 02:05, Lie Ryan <lie.1...@gmail.com> wrote:

> On 07/05/10 22:23, Adam Bark wrote:
>
> >
> > I should add that this is how something like:
> >
> > if x != y:
> >     do_something()
> >
> > works, if expects a True or False (this isn't always true but works for
> > comparison operators expressions such as this).
> >
>
> <nit> "if" expects an expression that can be converted to True or False
> by calling its __bool__()/__nonzero__(); in case of missing
> __bool__/__nonzero__, then the object is considered True. </nit>
>
>
Well put, I couldn't decide how to phrase it without adding confusion but
you hit the nail on the head.
Cheers,
Adam.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to