[Python-Dev] What should changing/setting __getattr__ (and similars) after classdef time do ?
Sat, 2 Jun 2001 20:58:55 +0200
Is this a case that only the BDFL could know and pronounce on ...
or I'm missing somenthing ...
Thanks for any feedback, Samuele Pedroni.
----- Original Message -----
From: Samuele Pedroni <email@example.com>
Sent: Friday, June 01, 2001 2:49 PM
Subject: [Python-Dev] __xxxattr__ caching semantic
> What is the intendend semantic wrt to __xxxattr__ caching:
> class X:
> def cga(self,name):
> print name
> def iga(name):
> print name
> x.__dict__['__getattr__'] = iga # 1.
> x.__getattr__ = iga # 2.
> X.__dict__['__getattr__'] = cga # 3.
> X.__getattr__ = cga # 4.
> for the manual
> with all the variants x.a should fail, they should have
> no effect. In practice 4. work.
> Is that an implementation manual mismatch, is this indented, is there
> code around using 4. ?
> I'm asking this because jython has differences/bugs in this respect?
> I imagine that 1.-4. should work for all other __magic__ methods
> (this should be fixed in jython for some methods),
> OTOH jython has such a restriction on __del__ too, and this one cannot
> be removed (is not simply a matter of caching/non caching).
> regards, Samuele Pedroni.
> Python-Dev mailing list