On Feb 20, 3:54 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> On 20 fév, 05:39, "George Sakkis" <[EMAIL PROTECTED]> wrote:
>
> > I was kinda surprised that setting __class__ or __dict__ goes through
> > the __setattr__ mechanism, like a normal attribute:
>
> But __class__ and __dict___ *are* 'normal' attributes...

Well, let alone for the fact that two leading and trailing underscores
means 'special' in python, these attributes are not exactly what they
seem to be, i.e. a 'normal' type or dict:

>>> type(object.__dict__['__class__'])
<type 'getset_descriptor'>
>>> type(type.__dict__['__dict__'])
<type 'getset_descriptor'>


George

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to