When I make a class definition I always go
Class A(object):
def __init__(self, arg):
self.arg = arg
def print_arg(self):
print(self.arg)
a = A('hello')
print a.arg
'hello'
But what I found in line 133 and 134 of https://github.com/Pylons/webob/blob/master/src/webob/request.py made me think what is the difference between what I did in Class A with:
Class B(object):
def __init__(self, arg):
self.__dict__['arg'] = arg
def print_arg(self):
print(self.arg)
b = B('goodbye')
print b.arg
'goodbye'