title: python global object cache
body: <p>Little question concerning app architecture:</p>
  
  <p>I have a python script, running as a daemon.</p>
  
  <p>Inside i have many objects, all inheriting from one class (let's name it 'entity')</p>
  
  <p>I have also one main object, let it be 'topsys'</p>
  
  <p>Entities are identified by pair (id, type (= class, roughly)), and they are connected in many wicked ways. They are also created and deleted all the time, and they are need to access other entities. </p>
  
  <p>So, i need a kind of storage, basically dictionary of dictionaries (one for each type), holding all entities.</p>
  
  <p>And the question is, what is better: attach this dictionary to 'topsys' as a object property or to class entity, as a property of the class? I would opt for the second (so entities does not need to know of existence of 'topsys'), but i am not feeling good about using properties directly in classes. Or maybe there is another way?</p>