{"issue":{"created_at":"2011-11-22T18:05:42Z","state":"closed","updated_at":"2011-11-25T09:34:13Z","comments":2,"user":{"gravatar_id":"bc3cbbdadcf7485288e502d084820c32","id":694081,"url":"https://api.github.com/users/jabbalaci","login":"jabbalaci","avatar_url":"https://secure.gravatar.com/avatar/bc3cbbdadcf7485288e502d084820c32?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"Hi,\r\n\r\nI would have some ideas for improvements.\r\n\r\nFirst, it should be called jsondb. You use json instead of pickle, so the name is very misleading. The line \"import json as pickle\" is terrible.\r\n\r\nI would put everything in a class. Then you could have an interface like this:\r\n\r\n    jdb = JsonDb('test.db')      # __init__ would do the job of your load() function\r\n    jdb.set('key', 'value')\r\n    jdb.get('key')\r\n\r\nGlobal variables are discouraged to use, but if you group everything in a class, you could use those variables in the class with 'self', like self.db, etc.\r\n\r\nAlso, you do lots of I/O operations. It should be kept in memory and the user could call dump himself: jdb.dump() , and then you write everything to a file.\r\n\r\nAdd comments to every function. At the end of the source, add this:\r\n\r\n    if __name__ == \"__main__\":\r\n        # write an example for every function\r\n        # then the users will understand immediately how to use it\r\n\r\nLaszlo","assignee":null,"number":1,"id":2320894,"labels":[],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"some improvements","closed_at":"2011-11-25T09:34:13Z","html_url":"https://github.com/patx/pickledb/issues/1","url":"https://api.github.com/repos/patx/pickledb/issues/1","milestone":null},"action":"closed"}