Skip to content

Commit 08afcc1

Browse files
committed
-
1 parent 01182ae commit 08afcc1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

python_toolbox/sequence_tools.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,11 @@ def pop_until(sequence, condition=bool):
275275

276276

277277
def get_recurrences(sequence):
278-
return {item: n_recurrences for item, n_recurrences in
279-
Counter(sequence).most_common() if n_recurrences >= 2}
278+
# Use when ditching Python 2.6:
279+
#return {item: n_recurrences for item, n_recurrences in
280+
#Counter(sequence).most_common() if n_recurrences >= 2}
281+
return dict((item, n_recurrences) for item, n_recurrences in
282+
Counter(sequence).most_common() if n_recurrences >= 2)
280283

281284
### Not using now, might want in future:
282285

0 commit comments

Comments
 (0)