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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

android - How to create dynamically Fragment pager adapter -