On Thu, Oct 6, 2011 at 1:22 PM, Daniel Drake <d...@laptop.org> wrote:
> On Thu, Oct 6, 2011 at 6:13 PM, Frederick Grose <fgr...@gmail.com> wrote: > > But try this: > > foo = 0 > > if foo: > > print 'foo is not None' > > Yes, I'm aware that the boolean operator also has meaning for > numerical values. But that doesn't affect my patch and the context of > this code. Or am I missing something? > > Thanks, > Daniel > "foo" alone as a boolean operator is an equivalent length check, > and also serves as a "is not None" check too. No, you are not missing something, but the casual reader may want to take note that if foo: serves only as a "is not None or is zero" check. So if foo is not None: is a more robust check for that singular condition. That's all, just an aside. Thanks. --Fred
_______________________________________________ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel