Created
May 23, 2014 03:30
-
-
Save mwaskom/151d48966f4553d019e0 to your computer and use it in GitHub Desktop.
Better to beg forgiveness than ask permission.
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 vectorize2(f): | |
def g(x): | |
try: | |
return [f(x) for x in x] | |
except TypeError: | |
return f(x) | |
return g |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment