def conv(arg,default=None,func=None):
if func:<EOL><INDENT>return func(arg) if arg else default;<EOL><DEDENT>else:<EOL><INDENT>return arg if arg else default;<EOL><DEDENT>
essentially, the generalization of

arg if arg else default

or

func(arg) if arg else default