[Zope] whats wrong with this code

Chris Kratz chris.kratz@vistashare.com
Thu, 8 Nov 2001 17:11:21 -0500


Hmmm, your code is correct for a dictionary.  I copied it directly into a
python script and it ran without error.  We do this quite often in some of
our python scripts:

--Python Script--

item = {}
item['hello'] = 'bye'
return item['hello']

-----------------

prints bye when you click the test tab.  Is there any other code that might
be giving you the len error?  My test was in Zope 2.4.1 running with a
compiled version of python 2.1.1 on RH 7.2.

-Chris
------------------------------
Chris Kratz
chris.kratz@vistashare.com

----- Original Message -----
From: "Clark OBrien" <COBrien@isis-server.vuse.vanderbilt.edu>
To: <zope@zope.org>
Sent: Thursday, November 08, 2001 4:22 PM
Subject: [Zope] whats wrong with this code


> These two lines of code won't work in zope scripts
>
> item = {}
> item['hello'] = 'bye'
>
>
> they give a len() of unsized object  error
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>