Re: Thoughts on object representation in a dictionary

2005-12-10 Thread Paul Rubin
"py" <[EMAIL PROTECTED]> writes: > Well the other thing is that I am allowed to store strings in this > dictionary...so 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. Probably so th

Re: Thoughts on object representation in a dictionary

2005-12-09 Thread Steven D'Aprano
On Fri, 09 Dec 2005 11:37:30 -0800, py wrote: > Say I have classes which represent parts of a car such as Engine, Body, > etc. Now I want to represent a Car in a nested dictionary like... > > {string_id:{engine_id:engine_object, body_id:body_object}}ok? > > Well the other thing is that I am

Re: Thoughts on object representation in a dictionary

2005-12-09 Thread Peter Hansen
py wrote: ... > Well the other thing is that I am allowed to store strings in this > dictionary...so 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. Homework? > So my question is th

Thoughts on object representation in a dictionary

2005-12-09 Thread py
Say I have classes which represent parts of a car such as Engine, Body, etc. Now I want to represent a Car in a nested dictionary like... {string_id:{engine_id:engine_object, body_id:body_object}}ok? Well the other thing is that I am allowed to store strings in this dictionary...so I can't j