Accessing class instance variables with vars().
Erik Max Francis
max at alcyone.com
Wed Feb 5 19:03:42 EST 2003
Andrew Bennetts wrote:
> I think I'd probably join them with:
> d = vars()
> d.update(vars(A))
> print '....' % d
I'd think you'd probably want those in reverse order, so as to mimic the
search order that Python itself would take when doing a getattr.
--
Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/ \ It comes from inside, and that's what I consider to be soul music.
\__/ Sade Adu
Esperanto reference / http://www.alcyone.com/max/lang/esperanto/
An Esperanto reference for English speakers.
More information about the Python-list
mailing list