[Sugar-devel] [PATCH 1/2] Fix presence detection of keyboard layouts/options

Frederick Grose fgrose at gmail.com
Thu Oct 6 13:13:58 EDT 2011


On Thu, Oct 6, 2011 at 10:58 AM, Daniel Drake <dsd at laptop.org> wrote:

> "foo is []" is not a valid way of checking if a list is empty
> as this code intends.
>
> "foo" alone as a boolean operator is an equivalent length check,
> and also serves as a "is not None" check too.
>

But try this:
foo = 0
if foo:
    print 'foo is not None'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20111006/57b6940a/attachment-0001.html>


More information about the Sugar-devel mailing list