sentinel = object()

def myfunc(arg1, arg2=sentinel):
    if arg2 is sentinel:
        arg2 = arg1
print((arg1, arg2))
In Python, can I specify a function argument's default in terms of other arguments?