accessor/mutator functions

Carl Banks invalidemail at aerojockey.com
Tue Mar 1 12:32:47 EST 2005


Steve Holden wrote:
> Carl Banks wrote:
> > Don't use getattr and setattr unless you have to construct the name
of
> > the attribute at run time.  That's what they're for.
> >
> Well, they are surely helpful in delegation contexts as well, or do I

> misunderstand?

I consider that a degenerate form of constructing a name at run time.
:)

You're right: I should have said, "Don't use them unless you don't know
the name at programming time."


-- 
CARL BANKS




More information about the Python-list mailing list