shelve
is meant to behave like a dict
which has changed... In Python 2.x dict
's use to return a list when .keys()
was called, in Python 3.x it returns a view object of the keys. If you want the actual keys, you have to materialise them to a list
:
keylist = list(db.keys())