1
No: this is perfectly normal function calling semantics.
In order for Python to call a function – in this case cache.get()
– it needs to know the value of all of its arguments. If one of the arguments is itself a function call, then that call must be made to resolve the value, before the outer function can be called.
(Note that it is possible to write a function that accepts a callable – for example, get_cm_subscribers_from_api
without the calling brackets – and for the function to determine that the parameter is callable, and call it only when necessary. But that’s up to the writer of the function, and isn’t anything you can affect in the calling code.)
Source:stackexchange.com