Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Make PickleShareDB inherit from collections.MutableMapping abc

  • Loading branch information...
commit 1ec897c122257b14aa3b00b26e056c2669a1cd4c 1 parent e57ac64
@takluyver authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 IPython/utils/
10 IPython/utils/
@@ -35,8 +35,8 @@
from IPython.external.path import path as Path
import os,stat,time
+import collections
import cPickle as pickle
-import UserDict
import glob
def gethashfile(key):
@@ -44,7 +44,7 @@ def gethashfile(key):
_sentinel = object()
-class PickleShareDB(UserDict.DictMixin):
+class PickleShareDB(collections.MutableMapping):
""" The main 'connection' object for PickleShare database """
def __init__(self,root):
""" Return a db object that will manage the specied directory"""
@@ -187,6 +187,12 @@ def keys(self, globpat = None):
files = [Path(p) for p in glob.glob(self.root/globpat)]
return [self._normalized(p) for p in files if p.isfile()]
+ def __iter__(self):
+ return iter(keys)
+ def __len__(self):
+ return len(keys)
def uncache(self,*items):
""" Removes all, or specified items from cache
Please sign in to comment.
Something went wrong with that request. Please try again.