Skip to content

Commit 4a83132

Browse files
committed
Fix more abc deprecation
1 parent fb288f0 commit 4a83132

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

python_toolbox/combi/perming/perm_space.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def __init__(self, iterable_or_length, n_elements=None, *, domain=None,
268268
if fixed_map is None:
269269
fixed_map = {}
270270
if not isinstance(fixed_map, dict):
271-
if isinstance(fixed_map, collections.Callable):
271+
if isinstance(fixed_map, collections.abc.Callable):
272272
fixed_map = {item: fixed_map(item) for item in self.sequence}
273273
else:
274274
fixed_map = dict(fixed_map)

python_toolbox/dict_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def remove_keys(d, keys_to_remove):
128128
if isinstance(keys_to_remove, collections.abc.Container):
129129
filter_function = lambda value: value in keys_to_remove
130130
else:
131-
assert isinstance(keys_to_remove, collections.Callable)
131+
assert isinstance(keys_to_remove, collections.abc.Callable)
132132
filter_function = keys_to_remove
133133
for key in list(d.keys()):
134134
if filter_function(key):

python_toolbox/emitting/emitter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def __init__(self, inputs=(), outputs=(), name=None):
7272
inputs = sequence_tools.to_tuple(inputs,
7373
item_type=Emitter)
7474
outputs = sequence_tools.to_tuple(outputs,
75-
item_type=(collections.Callable,
75+
item_type=(collections.abc.Callable,
7676
Emitter))
7777

7878
self._inputs = set()
@@ -220,15 +220,15 @@ def add_output(self, thing):
220220
If adding an emitter, every time this emitter will emit the output
221221
emitter will emit as well.
222222
'''
223-
assert isinstance(thing, (Emitter, collections.Callable))
223+
assert isinstance(thing, (Emitter, collections.abc.Callable))
224224
self._outputs.add(thing)
225225
if isinstance(thing, Emitter):
226226
thing._inputs.add(self)
227227
self._recalculate_total_callable_outputs_recursively()
228228

229229
def remove_output(self, thing):
230230
'''Remove an output from this emitter.'''
231-
assert isinstance(thing, (Emitter, collections.Callable))
231+
assert isinstance(thing, (Emitter, collections.abc.Callable))
232232
self._outputs.remove(thing)
233233
if isinstance(thing, Emitter):
234234
thing._inputs.remove(self)

python_toolbox/logic_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def get_equivalence_classes(iterable, key=None, container=set, *,
137137
new_dict[key] = container(value)
138138

139139
if sort_ordered_dict:
140-
if isinstance(sort_ordered_dict, (collections.Callable, str)):
140+
if isinstance(sort_ordered_dict, (collections.abc.Callable, str)):
141141
key_function = comparison_tools. \
142142
process_key_function_or_attribute_name(sort_ordered_dict)
143143
new_dict.sort(key_function)

0 commit comments

Comments
 (0)