I am learning Python and came across an example that I don't quite understand. In the official tutorial, the following code is given:
i = 5
def f(arg=i):
print(arg)
i = 6
f()
Coming from c++, it makes sense intuitively for me that this will print 5. But I'd also like to understand the technical explanation: "The default values are evaluated at the point of function definition in the defining scope." What does the "defining scope" mean here?