Storing objects in dictionary

Jeremy Jones zanesdad at bellsouth.net
Thu Nov 4 15:08:59 EST 2004


Feghhi, Jalil wrote:

>I get an error storing an object in a dictionary. The dictionary and the object are both provided by mod_python. One is the session object (which is just a dictionary) and one is a FieldStorage object (I think it is a class but displays as a dictionary). My question is what is the requirement for an object to be able to store it in a dictionary? I am sure there is documentaion somewehre but I couldn't find it.
>
>Regards,
>
>-Jalil
>  
>
Are you trying to use the session object as a key in the dictionary or a 
value of a key?  What error are you getting?  You should be able to put 
anything into a dictionary (AFAIK) as a key, but only hashable objects 
can be put in as keys.


Jeremy Jones



More information about the Python-list mailing list