Python has a "really hidden encapsulation"?

Aahz aahz at
Fri Nov 19 05:04:28 CET 2010

In article <87fwvw214g.fsf at>,
Arnaud Delobelle  <arnodel at> wrote:
>Are you referring to the fact that in Python, if an attribute is a
>property, the __dict__ lookup on the instance is not performed?  As in:
>>>> class A:
>...     @property
>...     def x(self): return 42
>>>> a = A()
>>>> a.__dict__['x'] = 24
>>>> a.x
>>>> a.__dict__['x']
>This is documented, but I actually don't know the reason for it.

Because otherwise you would be able to overwrite the property with a
Aahz (aahz at           <*>

"Look, it's your affair if you want to play with five people, but don't
go calling it doubles."  --John Cleese anticipates Usenet

More information about the Python-list mailing list