__dict__ is an attribute of every Python object. It's typically only
an internal detail, and generally not accessed directly. One area
where __dict__ modification would differ from attribute access is with
an attribute that's a property. Modifying the __dict__ would ignore
the property getter/setter code, where as modifying the attribute will
still invoke those methods. In other words, __dict__ manipulation
breaks encapsulation ... although in rare cases this is what you want
to do!
>>> class Foo(object): pass
...
>>> f = Foo()
>>> f.__dict__
{}
>>>
f.cat = 'dog'
>>> f.__dict__
{'cat': 'dog'}
>>> f.__dict__['cow'] = 'moo'
>>> f.cow
'moo'