Skip to content

Commit 7557f6c

Browse files
committed
-
1 parent b936349 commit 7557f6c

File tree

11 files changed

+14
-14
lines changed

11 files changed

+14
-14
lines changed

python_toolbox/combi/perming/perm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def __init__(self, perm_sequence, perm_space=None):
107107
'''
108108
perm_space = None if perm_space is None \
109109
else PermSpace.coerce(perm_space)
110-
assert isinstance(perm_sequence, collections.Iterable)
110+
assert isinstance(perm_sequence, collections.abc.Iterable)
111111
perm_sequence = sequence_tools. \
112112
ensure_iterable_is_immutable_sequence(perm_sequence)
113113

python_toolbox/combi/perming/perm_space.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def __init__(self, iterable_or_length, n_elements=None, *, domain=None,
165165
# #
166166
assert isinstance(
167167
iterable_or_length,
168-
(collections.Iterable, numbers.Integral)
168+
(collections.abc.Iterable, numbers.Integral)
169169
)
170170
if isinstance(iterable_or_length, numbers.Integral):
171171
assert iterable_or_length >= 0
@@ -186,7 +186,7 @@ def __init__(self, iterable_or_length, n_elements=None, *, domain=None,
186186
self.sequence = sequence_tools.CuteRange(iterable_or_length)
187187
self.sequence_length = iterable_or_length
188188
else:
189-
assert isinstance(iterable_or_length, collections.Iterable)
189+
assert isinstance(iterable_or_length, collections.abc.Iterable)
190190
self.sequence = sequence_tools. \
191191
ensure_iterable_is_immutable_sequence(iterable_or_length)
192192
range_candidate = sequence_tools.CuteRange(len(self.sequence))
@@ -753,7 +753,7 @@ def __getitem__(self, i):
753753

754754
def index(self, perm):
755755
'''Get the index number of permutation `perm` in this space.'''
756-
if not isinstance(perm, collections.Iterable):
756+
if not isinstance(perm, collections.abc.Iterable):
757757
raise ValueError
758758

759759
try:

python_toolbox/combi/selection_space.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def __getitem__(self, i):
7474

7575
def index(self, selection):
7676
'''Find the index number of `selection` in this `SelectionSpace`.'''
77-
if not isinstance(selection, collections.Iterable):
77+
if not isinstance(selection, collections.abc.Iterable):
7878
raise ValueError
7979

8080
selection_set = set(selection)

python_toolbox/dict_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def remove_keys(d, keys_to_remove):
118118
119119
If key doesn't exist, doesn't raise an exception.
120120
'''
121-
if isinstance(keys_to_remove, collections.Iterable):
121+
if isinstance(keys_to_remove, collections.abc.Iterable):
122122
for key in keys_to_remove:
123123
try:
124124
del d[key]

python_toolbox/math_tools/factorials.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def from_factoradic(factoradic_number):
7676
7777
'''
7878
from python_toolbox import sequence_tools
79-
assert isinstance(factoradic_number, collections.Iterable)
79+
assert isinstance(factoradic_number, collections.abc.Iterable)
8080
factoradic_number = \
8181
sequence_tools.ensure_iterable_is_sequence(factoradic_number)
8282
number = 0

python_toolbox/nifty_collections/bagging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ def get_contained_bags(self):
824824

825825

826826

827-
class _BaseDictDelegator(collections.MutableMapping):
827+
class _BaseDictDelegator(collections.abc.MutableMapping):
828828
'''
829829
Base class for a dict-like object.
830830

python_toolbox/nifty_collections/weak_key_default_dict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
#todo: needs testing
16-
class WeakKeyDefaultDict(collections.MutableMapping):
16+
class WeakKeyDefaultDict(collections.abc.MutableMapping):
1717
'''
1818
A weak key dictionary which can use a default factory.
1919

python_toolbox/nifty_collections/weak_key_identity_dict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __hash__(self):
2727
return self._hash
2828

2929

30-
class WeakKeyIdentityDict(collections.MutableMapping):
30+
class WeakKeyIdentityDict(collections.abc.MutableMapping):
3131
"""
3232
A weak key dictionary which cares about the keys' identities.
3333

python_toolbox/sequence_tools/canonical_slice.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def __init__(self, slice_, iterable_or_length=None, offset=0):
5050
elif isinstance(iterable_or_length, collections.abc.Sequence):
5151
self.length = sequence_tools.get_length(iterable_or_length)
5252
else:
53-
assert isinstance(iterable_or_length, collections.Iterable)
53+
assert isinstance(iterable_or_length, collections.abc.Iterable)
5454
self.length = cute_iter_tools.get_length(iterable_or_length)
5555
else:
5656
self.length = None

python_toolbox/sequence_tools/misc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def ensure_iterable_is_immutable_sequence(iterable, default_type=tuple,
241241
specified in `default_type`.
242242
'''
243243
from python_toolbox import nifty_collections
244-
assert isinstance(iterable, collections.Iterable)
244+
assert isinstance(iterable, collections.abc.Iterable)
245245
if not allow_unordered and \
246246
isinstance(iterable, nifty_collections.DefinitelyUnordered):
247247
raise UnorderedIterableException
@@ -263,7 +263,7 @@ def ensure_iterable_is_sequence(iterable, default_type=tuple,
263263
makes it into a `tuple`, or into any other data type specified in
264264
`default_type`.
265265
'''
266-
assert isinstance(iterable, collections.Iterable)
266+
assert isinstance(iterable, collections.abc.Iterable)
267267
if not allow_unordered and isinstance(iterable, (set, frozenset)):
268268
raise UnorderedIterableException
269269
if isinstance(iterable, collections.abc.Sequence) and \

0 commit comments

Comments
 (0)