Need help to understand a getattr syntax.

NMarcu marcu.nicolae at gmail.com
Tue Nov 24 16:47:40 CET 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