best practice for a script dict location in the api ?

I’m diving into the (marvellous, jaw dropping, unbelievable) 2.5 api since some days, and was wondering where are the best ‘locations’ to create dictionnaries, custom variables etc.

I would need a main dict available from different script ui / methods / maybe from BGE too. so I suppose it could be better to locate it in a common ‘location’ (how would you say that in real english ??)

should I create it in a special object as a property with smtg like :

main =['Empty']
main['vars']={ 'foo':10 , 'buildings':{} }

or in like in this example :

group ="MyTestGroup")
group["GameSettings"] = {"foo": 10, "bar": "spam", "baz": {}}

I’m surprised by the data.groups ‘location’ of the dict used in this example, since ‘MyTestGroup’ won’t show up in the ui and that


will also lists the groups created in the ui (properties panel / object / Groups/ +)

… or any other ways ?