Re:Lambdas and Functions in Python
by abecedarius on Saturday June 16, 2018 @07:54PM
(#17330150)
It looks like that reverses the arguments? You could do
args = self.stack[-n:]
del self.stack[-n:]
self.push(function_requested(*args))
or maybe self.stack[-n:] = [function_requested(*args)]Yeah oops coded that up quick. Either way you fix it, it’s far better than a function for calling each number of args and keeps the code readable.
For fun, an updated version that cleans up other things as well as the ordering, not relying on signatures of lambdas, etc.
https://pastebin.com/fMtc8Git