[Chandler-dev] Collection __nonzero__() changed

Andi Vajda vajda at osafoundation.org
Tue Jun 5 16:08:14 PDT 2007


On Tue, 5 Jun 2007, Andi Vajda wrote:

> Code that was written, assuming:
>
>  if collection:
>     ... # collection is None or some other 'False'-worth object
>  else:
>     ... # collection is an Item
>
> needs to change to reflect the new meaning:
>
>  if collection:
>      ... # collection is not None or an empty collection item
>  else:
>      ... # collection is None or an empty collection item
>

In other words, code now needs to check against None instead.

   if collection is not None:
     ...

Andi..


More information about the chandler-dev mailing list