Skip to content

Commit

Permalink
avoid dict comprehension for py 2.6 support
Browse files Browse the repository at this point in the history
  • Loading branch information
brad committed Dec 23, 2014
1 parent 0067b4a commit f4b9539
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions misfitapp/extras.py
Expand Up @@ -37,6 +37,5 @@ def dedupe_by_field(l, field):
Returns a new list with duplicate objects removed. Objects are equal
iff the have the same value for 'field'.
"""
d = {getattr(obj, field): obj for obj in l}
d = dict((getattr(obj, field), obj) for obj in l)
return list(d.values())

0 comments on commit f4b9539

Please sign in to comment.