I am trying to get a list of member variables of a class.
class Book(object):
def __init__(self):
self.title='Inferno'
self.author = 'Dan Brown'
self.publisher= 'DoubleDay'
self.pages=480
bk = Book()
p=bk.__dict__
print p.keys()
The output is:
['publisher', 'author', 'pages', 'title']
I am curious here as the list is neither printedalphabetically nor according to the way I listed the class variables. So in what way does python print it out?