Can Python do this?

Paul Rubin phr-n2002a at nightsong.com
Mon Mar 4 16:18:30 EST 2002


quinn at barf.ugcs.caltech.edu (Quinn Dunkan) writes:
> Really?
> ...
> >>> a.m
> <method A.m of B instance at 100e3f14>
> >>> getattr(a, 'm')
> <method A.m of B instance at 100e3f14>
> >>> 
> 
> Or did you mean something else?

Oops, thanks.  Yes, that's what I meant, but my test case had an error.
I'm glad getattr works the way I'd hoped/expected it did.



More information about the Python-list mailing list