from my understanding of the code  you do not actually need a dictionary  it appears that you just need to be able to set arbitrary attributes on a dummy object  you could import userdict u userdict userdict u slavetoken  slavetoken  u slavetoken  slavetoken 