3 ms·
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
by abecedarius 8y ago
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)]
- adjkant 8y agoYeah 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.
- adjkant 8y agoFor fun, an updated version that cleans up other things as well as the ordering, not relying on signatures of lambdas, etc. https://pastebin.com/HF41J8KQ https://pastebin.com/HF41J8KQ