[Tutor] getattr help
mjolewis at gmail.com
mjolewis at gmail.com
Sat Mar 10 08:20:40 CET 2012
What is the purpose of getattr? Why not just use help or am I completely misunderstanding this?
From what I read, getattr allows you to get a reference to a function without knowing its name until runtime.
However, the example provided is:
li = ['larry', 'curly]
getattr(li, 'pop')
It seems to me that I need to know the name of the function to use getattr?
Please help.
Sent from my iPhone
More information about the Tutor
mailing list