Get list of instance variables and it's default values in python

Viewed 51

Given a class

class MyClass:

    def __init__(self, x=0, y=0):
        self.a = x
        self.b= y

How can i get the a list or something that contais the name as a string of the instance variables (in this case, a and b) and its default values, but for any class?

0 Answers
Related