dgilland / pydash

The kitchen sink of Python utility libraries for doing "stuff" in a functional way. Based on the Lo-Dash Javascript library.

Home Page:http://pydash.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pydash.objects.pick should return None if key is not exist in the target

d46 opened this issue · comments

commented

Do you mean like this?

import pydash

obj = {"a": 1, "b": 2}
keys = ["a", "b", "c"]
result = {k: pydash.get(obj, k) for k in keys}
result == {"a": 1, "b": 2, "c": None}