def optionally(preprocessor):
 @wraps(preprocessor)
 def wrapper(func, argname, arg):
  return (arg if (arg is None) else preprocessor(func, argname, arg))
 return wrapper

def optionally ( preprocessor ) : @ wraps ( preprocessor ) def wrapper ( func , argname , arg ) : return ( arg if ( arg is None ) else preprocessor ( func , argname , arg ) ) return wrapper
modify a preprocessor to explicitly allow none .