Skip to content

Commit

Permalink
drop kwargs-in-constructor feature
Browse files Browse the repository at this point in the history
  • Loading branch information
mgax committed Oct 2, 2012
1 parent 701ff01 commit bab7a96
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
3 changes: 1 addition & 2 deletions kv.py
Expand Up @@ -4,10 +4,9 @@

class KV(MutableMapping):

def __init__(self, **kwargs):
def __init__(self):
self._db = sqlite3.connect(':memory:')
self._execute('CREATE TABLE data (key TEXT PRIMARY KEY, value TEXT)')
self.update(kwargs)

def _execute(self, *args):
return self._db.cursor().execute(*args)
Expand Down
4 changes: 0 additions & 4 deletions tests.py
Expand Up @@ -48,10 +48,6 @@ def test_updated_item_is_retrieved_via_getitem(self):
kv['a'] = 'c'
self.assertEqual(kv['a'], 'c')

def test_constructor_kwargs_retrieved_via_getitem(self):
kv = KV(a='b')
self.assertEqual(kv['a'], 'b')

def test_udpate_with_dictionary_items_retrieved_via_getitem(self):
kv = KV()
kv.update({'a': 'b'})
Expand Down

0 comments on commit bab7a96

Please sign in to comment.