News for hackers. Stuff that matters.
Re:The unknown features of Python's `operator` module by icegreentea2 on Sunday August 08, 2021 @03:37PM (#28109439)
`methodcaller` (https://github.com/python/cpython/blob/6a6bcf16370beff2e0d1a...) is just syntax sugar around `getattr` + a function call which is just syntax sugar + default implementation of `__getattr__` which is basically exactly what it looks like your lua example is (I'm not that familiar with lua).

Actually, I didn't even know about `methodcaller` till I read this blogpost, so I would have implemented your example in python as: `getattr(table, string)(...)`.

There are no comments on this comment yet.