Dear List,

I'm stuck on trying to write a generic 'report' function:

Class SomeClass:
   def __init__(self,a,b):
        self.a = a
        self.b = b

   def report(self):
        for i in dir(self):
            print self.i

<Error Traceback......>


This is where I run into problems: How do I return all of the variables
in an instance?

I'm sure I'm not the first person to ask, but I couldn't find an answer
anywhere else...

Thanks,

Matt
-- 
Dr. M. Williams MRCP(UK)
Clinical Research Fellow
Cancer Research UK
+44 (0)207 269 2953
+44 (0)7384 899570

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to