In search of python idiom for accessing arbitrary fields at run time

Jean-Paul Calderone exarkun at divmod.com
Sun Jul 8 20:30:43 CEST 2007


On Sun, 08 Jul 2007 18:21:41 -0000, mshiltonj <mshiltonj at gmail.com> wrote:
>I'm trying to find the preferred python idiom for access arbitrary
>fields of objects at run time.
>

It's not an idiom, it's a built-in function: getattr.

Jean-Paul



More information about the Python-list mailing list