Referencing vars, methods and classes by name

Paul Rubin http
Thu Feb 8 03:51:19 EST 2007


"Gabriel Genellina" <gagsl-py at yahoo.com.ar> writes:
> >    obj.getattr(a)()
> > but even that is a bit ugly, depending.
> Surely you meant to say getattr(obj, a)()

Yeah, darn.  Counterintuitive.  I keep making that error in my own
code too.  Maybe I should put in an RFE.



More information about the Python-list mailing list