Skip to content

Commit

Permalink
Prefer dict over OrderedDict
Browse files Browse the repository at this point in the history
Starting with Python 3.6, the builtin dict retains its order. Using
OrderedDict is no longer necessary.
  • Loading branch information
jdufresne committed Mar 10, 2021
1 parent 264cc84 commit fe6dd97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion piptools/utils.py
Expand Up @@ -207,7 +207,7 @@ def dedup(iterable: Iterable[_T]) -> Iterable[_T]:
"""Deduplicate an iterable object like iter(set(iterable)) but
order-preserved.
"""
return iter(collections.OrderedDict.fromkeys(iterable))
return iter(dict.fromkeys(iterable))


def get_hashes_from_ireq(ireq: InstallRequirement) -> Set[str]:
Expand Down

0 comments on commit fe6dd97

Please sign in to comment.