class Foo(object):

    def setUp(self):
        self.var1 = 'some value'
self.var2 = 'something'

def bar(self):
    var3 = 'some value'

def baz(self, var):
    pass
How to get names of all the variables defined in methods of a class