3 ms·
So a function: def fun(*args): if not args: return 0 return fun(*(args[1:])) would be call-by-address after the first invocati
by Beltiras 9y ago
So a function:
def fun(*args):
if not args:
return 0
return fun(*(args[1:]))
would be call-by-address after the first invocation? It could be lookup-by-name by way of code.
- chrisseaton 9y agoThe naive implementation, and the semantic model, is always lookup-by-name on every invocation. In practice we apply speculative optimisations including inline caching and guard removal with remote dynamic deoptimisation via safe points to make it a direct call instead.