python - Unstable behaviour of has_key shelve method -


i've been using shelve library python (not in multiprocessing environment), , i've been observing unstable behaviour when using has_key() method. returns true , false, when know key exists in shelve. usual cause of such behaviour?

import shelve  some_key = 'not relevant' s = shelve.open('cache.db') if s.has_key(some_key):    var = s[some_key]    print 'found key', some_key  s.close() 

note: python 2.7, ubuntu 14.04 in vm virtualbox, running in i7 x86-64bit


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -