-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdriver.py
More file actions
35 lines (26 loc) · 726 Bytes
/
Copy pathdriver.py
File metadata and controls
35 lines (26 loc) · 726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
from pprint import pprint
from flywrench import Flywrench, Cache
def hash1(obj):
return 'hash1:'+'-'.join([str(e) for e in obj])
def hash2(obj):
return 'hash2:'+'.'.join([str(e) for e in obj])
class SomeClass(Flywrench):
cache = Cache(hash_algorithm=hash1)
def __init__(self, i):
self.test = i
class OtherClass(Flywrench):
cache = Cache(hash_algorithm=hash2)
def __init__(self, i):
self.test = i
temp = [SomeClass([1]),
SomeClass((4, 5, 6)),
SomeClass([2, 3]),
SomeClass((7, 8)),
OtherClass([1]),
OtherClass((4, 5, 6)),
OtherClass([2, 3]),
OtherClass((7, 8))]
pprint(SomeClass.cache.d)
pprint(OtherClass.cache.d)
"""