0

After running the following code, I found that the name of the dictionary in file memo.py is memo. I want to change the name of the dictionary in that file. Do anyone know how to do it?

>>> init = {'y': 2, 'x': 1, 'z': 3}
>>> import klepto
>>> cache = klepto.archives.file_archive('memo', init, serialized=False)
>>> cache        
{'y': 2, 'x': 1, 'z': 3}
>>>
>>> # dump dictionary to the file 'memo.py'
>>> cache.dump() 
>>> 
>>> # import from 'memo.py'
>>> from memo import memo
>>> print memo
{'y': 2, 'x': 1, 'z': 3}
>>> from memo import memo
>>> print memo
{'y': 2, 'x': 1, 'z': 3}
gehbiszumeis
  • 3,525
  • 4
  • 24
  • 41
mary
  • 1
  • 1

1 Answers1

0

I'm the klepto author. I don't believe it's possible, currently. However, if you do want it as a feature, then feel free to request it (on klepto's GitHub) as an enhancement.

Mike McKerns
  • 33,715
  • 8
  • 119
  • 139