Hi all

I have the following question: I need a representation of a physically inspired environment. The environment contains a large number of objects with varying attributes. There may be classes of objects, but there is not necessarily a strictly defined hierarchy among them. Object access should be fast, because there a many objects that change often ( e.g., moving objects).

My approach is to use a dictionary for the environment model and store each object as a slot, which contains either a dictionary or an object. Now, which is better? What is the performance of Python to look up attributes as either slots of a dictionary or attributes of an object? What feels more logical? What is more pythonic and performs better? Which is constructed and modified easier and quicker? Are there effects that I am not yet aware of?

thanks for your thoughts
Andre

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to