matching keyword arguments to specific methods

Donnal Walter donnalcwalter at yahoo.com
Mon Jan 27 18:42:21 EST 2003


"Paul Rubin" <phr-n2003b at NOSPAMnightsong.com> wrote:
> I don't quite understand your example but I think you want something like:
>
>     if hasattr(self, key):
>        getattr(self,key)(whatever)

Yes, that works perfectly. Thanks.
Donnal Walter








More information about the Python-list mailing list