from datetime import datetime
from time import sleep
def a1(v=datetime.utcnow()):
print(v)
if __name__ == '__main__':
a1()
sleep(1)
a1()
result:
2020-07-06 11:26:31.959986
2020-07-06 11:26:31.959986
When calling a function that has for default parameter a method call, why is the result always the same?
shouldn't be executed every time the method is called?