[Tutor] putting instance variables into a dict

Shuying Wang shuying at gmail.com
Mon Jan 30 00:52:48 CET 2006


Hi,

So I've got a class X with instance variables a, b, c. Is there any
way of creating a dictionary of these instance variables besides the
no-brainer way of doing dictionary = {'a' : X.a, 'b' : X.b, 'c' : X.c}
?

--Shuying


More information about the Tutor mailing list