I am using cdb for a constant database in python. I would like to associate integer id's with some strings, and I would like to avoid storing each of these integer id's as strings, and instead store them as an integer. cdb though is looking for either a string or a read only buffer. Is there a way that I can store these keys as integers instead of strings?
For example:
cdb = cdb.cdbmake("test.cdb","test.cdb.tmp")
key = 5
value = "some test string"
#this throws an error
maker.add(key,value)
#TypeError: add() argument 1 must be string or read-only buffer, not int
#this would work, but seems inefficient
maker.add(str(key),value)