[Zope-dev] bizarre slicing behaviour in Zope

Paul Winkler pw_lists at slinkp.com
Wed Dec 17 15:57:38 EST 2003


On Wed, Dec 17, 2003 at 03:30:50PM -0500, Gerry Kirk wrote:
> try this in a script in zope 2.7b3 (maybe others, too) if you want to go 
> crazy:
> 
> dd = ('dd', 'diocese', 'Parish.2003-12-16.8636751973', 'bob', 
> 'Workspace.2003-12-17.8140751750','gerry.2003-12-17.8140751750')
> 
> return dd[4:]
> 
> you should get the last two items from the tuple, but I get the last 
> item returned as a string

I tried 2.6 as well.  Check the source of the returned page. 
I think you will find this:

<html>
<head>
<title>Workspace.2003-12-17.8140751750</title>
</head>
<body>
gerry.2003-12-17.8140751750
</body>
</html>

It seems to happen with any tuple... I tried this script:

return ('foo', 'bar')

... and got this:

<html>
<head>
<title>foo</title>
</head>
<body>
bar
</body>
</html>

Returning a list instead of a tuple is OK - it shows a string
representation of the list.

I would guess that you are right, this is odd publisher behavior.
File a collector issue.

-- 

Paul Winkler
http://www.slinkp.com




More information about the Zope-Dev mailing list