Created
May 19, 2012 19:53
-
-
Save andialbrecht/2732200 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
from collections import OrderedDict | |
except ImportError: | |
OrderedDict = None | |
from UserDict import UserDict | |
if OrderedDict is not None: | |
class Cache(OrderedDict): | |
def flush(self): | |
# remove oldest entries | |
else: | |
class Cache(UserDict): | |
def flush(self): | |
self.data = {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment