We'll need to see your 'equivalent' python script and how you call it. Lists work fine in python scripts but there is sometimes voodoo in calling said scripts or getting results back from them.
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Eric Roby Sent: Friday, November 08, 2002 4:33 AM To: zope@zope.org Subject: [Zope] passing lists as function parameters
Maybe I am really missing something here, but for some time, I have been trying to figure out why when I pass a list to a python script, it becomes a sequence of characters. When I duplicate the process within the interpreter, it works as I expect it to. An example to demonstrate what I am talking about:
Interpreter test-
listDef = [1,2,3,4,5] def foo(x): ... for member in x: .... print member ... foo(listDef) 1 2 3 4 5
In Zope, if I create the equivalent of the foo function in a python script, passing a list in the parameter field, I get the following: 1 , 2 , 3 , 4 , 5
Or if I test the script with the following value for the parameter - [1,2,3,4,5] - I get: [ 1 , 2 , 3 , 4 , 5 , ] so ... len(theList) returns a value that represents the count of all characters in the list definition - not the number of items in the list.
Any enlightenment here would be greatly appreciated. I hesitate to call 'BUG' cause it might be me that is 'buggy'...
TIA
Eric