We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 01182ae commit 08afcc1Copy full SHA for 08afcc1
python_toolbox/sequence_tools.py
@@ -275,8 +275,11 @@ def pop_until(sequence, condition=bool):
275
276
277
def get_recurrences(sequence):
278
- return {item: n_recurrences for item, n_recurrences in
279
- Counter(sequence).most_common() if n_recurrences >= 2}
+ # Use when ditching Python 2.6:
+ #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)
283
284
### Not using now, might want in future:
285
0 commit comments