Skip to content

Commit 85686f8

Browse files
authored
Fix immutability check: sets are not immutable. (#132)
1 parent 899d23b commit 85686f8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

zookeeper/core/utils.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,16 @@ def wrapper():
117117
def is_immutable(value: Any) -> bool:
118118
"""
119119
Decide the immutability of `value`. Recurses a single level if `value` is a
120-
set or a tuple, but does not recurse infinitely.
120+
tuple, but does not recurse infinitely.
121121
"""
122122
return (
123123
value is None
124124
or isinstance(value, (int, float, bool, str, frozenset))
125125
or (
126-
isinstance(value, (set, tuple))
126+
isinstance(value, tuple)
127127
and all(
128-
isinstance(inner_value, (int, float, bool, str, frozenset))
128+
inner_value is None
129+
or isinstance(inner_value, (int, float, bool, str, frozenset))
129130
for inner_value in value
130131
)
131132
)

0 commit comments

Comments
 (0)