Skip to content

Commit

Permalink
Remove simple_cache, no longer needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed May 24, 2020
1 parent 4681bc2 commit 5ac7618
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions path/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,6 @@ def compose(*funcs):
return functools.reduce(compose_two, funcs)


def simple_cache(func):
"""
Save results for the :meth:'path.using_module' classmethod.
When Python 3.2 is available, use functools.lru_cache instead.
"""
saved_results = {}

def wrapper(cls, module):
if module in saved_results:
return saved_results[module]
saved_results[module] = func(cls, module)
return saved_results[module]

return wrapper


class ClassProperty(property):
def __get__(self, cls, owner):
return self.fget.__get__(None, owner)()
Expand Down Expand Up @@ -194,7 +178,7 @@ def __init__(self, other=''):
raise TypeError("Invalid initial value for path: None")

@classmethod
@simple_cache
@functools.lru_cache
def using_module(cls, module):
subclass_name = cls.__name__ + '_' + module.__name__
bases = (cls,)
Expand Down

0 comments on commit 5ac7618

Please sign in to comment.