[Zope] error with tal:condition="python:x in s"

Hedley Roos hedley@ise.co.za
Tue, 17 Sep 2002 12:47:35 +0200


It seems as though s is not treated as a list of strings, rather as a single
string. 'In' would thus look for a character, since a string is a list of
characters.

Hedley


-----Original Message-----
From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of H.
Christian Gromoll
Sent: 17 September 2002 12:34
To: zope@zope.org
Subject: [Zope] error with tal:condition="python:x in s"


Greetings.

I was wondering if this is a bug, or if I'm just doing something wrong.

I'm trying the following page template code:

<span tal:condition="python:'string' in s"> </span>

s is a list of strings. I'm trying to condition on membership of
'string' in the list s, but I get the following error:

exceptions.TypeError on 'in ' requires character as left operand in "",
at line 56, column 4

any help would be appreciated.

regards,
Christian Gromoll






_______________________________________________
Zope maillist  -  Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )