Need help to understand a getattr syntax.

NMarcu marcu.nicolae at gmail.com
Tue Nov 24 10:47:40 EST 2009


Hello all,
    I need some help to understand a getattr syntax. The syntax is:

try:
    getattr(self, command)(cursor, row)
except Exception, e:
    print "Action failed : '%s'" % command
    raise e

I don't understand why is not like this: a = getattr(), and what are
the scope of the second (): (cursor, row)

Thanks.



More information about the Python-list mailing list