Skip to content

Instantly share code, notes, and snippets.

Created Sep 13, 2017
What would you like to do?
def maybe(f, v, default=None):
Return C{f(v)} if C{v} is not C{None}, otherwise return C{default}.
if v is None:
return default
return f(v)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment