[Zope] Re: upgrade 2.5.1 to 2.7.5 causes error in product code

Jens Vagelpohl jens at dataflake.org
Sun Aug 28 03:34:29 EDT 2005


On 27 Aug 2005, at 20:15, John Schinnerer wrote:
> python:here.sponsors[0] != ''
>
> if the tuple is empty, whereas 2.5.1/2.1.3 must have been returning
> some equivalent of boolean 'false' when the tuple was empty.

No. Python 2.1.3 would have blown up the same way.


> Now I do this
>
> python: (here.sponsors) and (here.sponsors[0] != '')
>
> and it works again.
> The second condition may be redundant now I suppose...?

No it is not redundant. A value ('',) would still be True as far as  
Python is concerned and would pass the first condition.

jens



More information about the Zope mailing list