Created
July 3, 2014 16:43
-
-
Save thezerobit/8a423846a230c55e53ae to your computer and use it in GitHub Desktop.
some python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def values_in(keys, dict_): | |
Nothing = object() | |
vals = (dict_.get(key, Nothing) for key in keys) | |
return [x for x in vals if x is not Nothing] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment