19 Apr
2002
19 Apr
'02
6:13 p.m.
H.de.Wit@SFK.NL writes:
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 No, they return the correct tuple.
However, "ZPublisher.HTTPResponse.setBody" does special things with some special return values. Most prominently: * an Python false value is translated into an empty response. This leads many browsers to wait forever... * a pair is interpreted as "title,body". That's your case. When you look at the HTML source, you will see your first element wrapped in a <title> and your second element in a <body> tag. Dieter