[Zope] adventure: return tuples from python scripts

Evan Simpson evan@4-am.com
Fri, 19 Apr 2002 11:38:17 -0500


H.de.Wit@SFK.NL wrote:
> 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

This should only happen if you attempt to invoke the script directly 
with a URL, or otherwise cause the tuple to be returned as an HTTP 
response.  Zope tries to render non-string results in a reasonable way, 
but 2-tuples are a special case.  Zope interprets a 2-tuple response as 
(title, body).

Cheers,

Evan @ 4-am