DeprecationWarning
See the question in the example below. What is the cause off the inconsistency with respect to generating the DeprecationWarning?
def testing(fn):
print(fn(1))
return
expr=x
testing(expr) # Yields DeprecationWarning: Substitution using function-call syntax and unnamed arguments ...
print(expr(1)) # No deprecation warning here. Why?
fn(x)=x
testing(fn) # No deprecation warnings here either.
print(fn(1))
Because in the second case fn is a function that knows its arguments, not a random expression
I understand about the second case. However, it is the first example that is puzzling me.