All,
A class:
class foo():
def __init__(self):
self.avar1 = 0
self.bvar2 = 1
self.cvar3 = 3
def debug_info(self):
print "avar1:" avar1
print "bvar2:" bvar2
print "cvar3:" cvar3
my question, it is too complex to write the debug_info() if I got a lot of self.vars ,then I want to migrate them into a dict to print them in one go for debug and monitor purpose, however, maybe I do not want to lost the format
foo.avar1 = 0
to access the vars inside of the class, because it is easy to read and easy to use and modify. Do you have better idea instead of visit the class.dict for the debug_info output? or does someone knows a better way to make this class more simple?
Thanks!