Skip to content

Commit 8e176fe

Browse files
committed
-
1 parent 760154a commit 8e176fe

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

source_py3/python_toolbox/combi/perming/perm_space.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ def _unsliced_length(self):
420420
return calculate_length_of_recurrent_perm_space(
421421
self.n_elements - len(self.fixed_map),
422422
nifty_collections.FrozenBagBag(
423-
collections.Counter(self.free_values).values()
423+
nifty_collections.Bag(self.free_values).values()
424424
)
425425
)
426426
else:

source_py3/python_toolbox/sequence_tools/misc.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ def are_equal_regardless_of_order(seq1, seq2):
3030
3131
Currently will fail for items that have problems with comparing.
3232
'''
33-
return collections.Counter(seq1) == collections.Counter(seq2)
33+
from python_toolbox import nifty_collections
34+
return nifty_collections.Bag(seq1) == nifty_collections.Bag(seq2)
3435

3536

3637
def flatten(iterable):
@@ -224,8 +225,9 @@ def get_recurrences(sequence):
224225
225226
The values of the dict are the numbers of repititions of each item.
226227
'''
228+
from python_toolbox import nifty_collections
227229
return {item: n_recurrences for item, n_recurrences in
228-
collections.Counter(sequence).most_common() if n_recurrences >= 2}
230+
nifty_collections.Bag(sequence).most_common() if n_recurrences >= 2}
229231

230232

231233
def ensure_iterable_is_immutable_sequence(iterable, default_type=tuple,

0 commit comments

Comments
 (0)