John Nagle <[EMAIL PROTECTED]> wrote:

> Marcin Ciura wrote:
> 
> > Neither would I. I must have expressed myself not clearly enough.
> > Currently
> > x = y = z
> > is roughly equivalent to
> > x = z
> > y = z
> > I propose to change it to
> > y = z
> > x = z
> 
> Actually, it is equivalent to
> 
>       y = z
>       x = y

Not really:

>>> class chatty(object):
...   def __init__(self): self.__dict__['__hide'] = {}
...   def __setattr__(self, name, value):
...     print 'sa', name, value
...     self.__dict__['__hide'][name] = value
...   def __getattr__(self, name):
...     print 'ga', name
...     return self.__dict__['__hide'].get(name)
... 
>>> c = chatty()
>>> x = c.zop = 23
sa zop 23
>>>

As you can see, there is no read-access to c.zop, which plays the role
of y there.


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

Reply via email to