[Python-ideas] Computed attribute names (Re: Assignment decorators)

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Mar 4 05:00:37 CET 2011


MRAB wrote:
> Or:
> x = a.(name)

That's what I'd go for as well, if I were to go for
something like this at all.
FWIW, there is one thing you could do with this that
is currently rather painful:
 x.(name) += 1
Doing that with getattr/setattr currently requires
about 3 lines of code.
-- 
Greg


More information about the Python-ideas mailing list

AltStyle によって変換されたページ (->オリジナル) /