[Zope] int's as keys for dictionaries

Bryce Harrington bryce at osdl.org
Tue May 25 21:49:17 EDT 2004


On Tue, 25 May 2004, Paul Winkler wrote:

> On Tue, May 25, 2004 at 06:15:09PM -0700, Bryce Harrington wrote:
> > I'm running into an issue I don't understand when using ints as keys in
> > hashes.
> >
> >
> > <dtml-let d_test_parameter="{'1':'a', '2':'b'}">
>
> You're using strings as hashes, not ints.
> {'1':'a'} is not {1: 'a'}.

Yes, that is correct.  The data structure has strings, but I need to
access them using ints as keys.  So I have to convert the ints into
strings in order to retrieve the data.

Bryce




More information about the Zope mailing list