"eval vs operator.methodcaller" - which is better?

Chris Angelico rosuav at gmail.com
Mon Mar 18 10:04:50 EDT 2013


On Tue, Mar 19, 2013 at 12:58 AM, Jean-Michel Pichavant
<jeanmichel at sequans.com> wrote:
> myFunc = getattr(myModule, methodName)

Doh! Thanks. I knew there was a shorter way of spelling it, rather
than digging with dunder methods. That's the way I would recommend -
slight tweak from the __getattribute__ version.

ChrisA



More information about the Python-list mailing list