[Zope] adventure: return tuples from python scripts

H.de.Wit@SFK.NL H.de.Wit@SFK.NL
Thu, 18 Apr 2002 18:31:57 +0200


Hello,

We tried to return a tuple from a function and had strange results
The following advanced python-scripts (the scripts are inside the quotes)
"return (1,2)" , "return 1,2", "return tuple((1,2))"

all return only 2

while the next scripts
"return (1,2)," and "return ((1,2),)"

both return ((1,2),)

But now this one:
"return tuple((1,2),)"
it gives 2

Is this correct? To us it is rather funny, because Python is doing this
'correct'.

Our Zope version is 2.5.0

Hans de Wit
Stichting Farmaceutische Kengetallen
Postbus 30460
2500 GL  DEN HAAG
Tel. 070-3737448
Fax 070-3737445