Jeff Epler wrote:
> > >>> id(c.f) == id(C.__dict__['f'].__get__(c,C))
> > True
>
> Here, c.f is discarded by the time the right-hand-side of == is
> executed.  So the object whose id() is being calculated on the
> right-hand-side could turn out to be the same, since the two objects
> have disjoint lifetimes.

Understood. I guess I was influenced by C++ where a temporary survives
up to the end of the complete statement in which it was created. Right
?

SB

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

Reply via email to