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
Post a Comment