mirror of
https://github.com/SynologyOpenSource/pkgscripts-ng.git
synced 2025-08-06 11:02:26 +00:00
12 lines
233 B
Python
12 lines
233 B
Python
|
|
class cache(dict):
|
|
def __init__(self, func):
|
|
self.func = func
|
|
|
|
def __call__(self, *args):
|
|
return self[args]
|
|
|
|
def __missing__(self, key):
|
|
result = self[key] = self.func(*key)
|
|
return result
|