For example, I have a function which does something to data, and takes a name as an optional argument. If the name is not supplied, I want to call another argument to create the name. So the alternatives seem to be either
def do_something(data, name=get_name()):
...
or
def do_something(data, name=None):
if name is None:
name=get_name()
...
The first one seems better to me, but am I missing something?