File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ def hashable(a) -> int:
96
96
if isinstance (a , (tuple , list )):
97
97
# lists are mutable and not hashable by default
98
98
# for memoization, we need the hash to depend on the items
99
- return hash (tuple (map ( hashable , a ) ))
99
+ return hash (tuple (hashable ( i ) for i in a ))
100
100
try :
101
101
return hash (a )
102
102
except TypeError :
Original file line number Diff line number Diff line change @@ -57,13 +57,11 @@ def test_hashing_of_rv_tuples():
57
57
random = pm .Normal .dist (mu , sd ).random ,
58
58
observed = obs ,
59
59
)
60
- print ()
61
60
for freerv in [mu , sd , dd ] + pmodel .free_RVs :
62
61
for structure in [
63
62
freerv ,
64
- dict ( alpha = freerv , omega = None ) ,
63
+ { " alpha" : freerv , " omega" : None } ,
65
64
[freerv , []],
66
65
(freerv , []),
67
66
]:
68
- print (f"testing hashing of: { structure } " )
69
67
assert isinstance (memoize .hashable (structure ), int )
You can’t perform that action at this time.
0 commit comments