I want to use a tuple (1,2,3) as a key using the shelf module in Python. I can do this with dictionaries:
d = {}
d[(1,2,3)] = 4
But if I try with a shelf:
s = shelve.open('myshelf')
s[(1,2,3)] = 4
I get: "TypeError: String or Integer object expected for the key, found tuple"
Any suggestions?
anon_y_mouse
source
share