Skip to content
This repository has been archived by the owner on Sep 4, 2023. It is now read-only.

Commit

Permalink
Improve pick
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiors committed Sep 4, 2020
1 parent 5c3bf33 commit eaae4b8
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pyramda/dictionary/pick.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,4 @@

@curry
def pick(keys, dict):
picked_dict = {}
for k in keys:
if k in dict:
picked_dict[k] = dict[k]
return picked_dict
return {k: v for k, v in dict.items() if k in keys}

0 comments on commit eaae4b8

Please sign in to comment.