Thoughts on object representation in a dictionary

Peter Hansen peter at
Fri Dec 9 21:21:18 CET 2005

py wrote:
> Well the other thing is that I am allowed to store strings in this
> I can't just store the Engine and Body object and later
> use them.  ....this is just a requirement (which i dont understand
> either)...but its what I have to do.


> So my question is there a good way of storing this information in a
> nested dictionary such that if I receive this dictionary I could easily
> pull it apart and create Engine and Body objects with the information?
> Any suggestions at all?  keep in mind I am limited to using a
> dictionary of strings...thats it.

You're describing a task that is named "serialization".  Google for 
"python serialization" and you'll get lots of useful and interesting 
background to help you out.


More information about the Python-list mailing list