spock
6/11/2017 - 11:30 AM

Use none and docstrings to specify dynamic default arguments

Use none and docstrings to specify dynamic default arguments

def log(message, when=None):
    when = datetime.now() if when is None else when
    print(' % s: % s' % (when, message)