[Python-Dev] PEP 231, __findattr__()

Christian Tismer tismer@tismer.com
Mon, 04 Dec 2000 20:35:19 +0200


Moshe Zadka wrote:
> 
> > I'm still catching up on several hundred emails over the weekend.  I
> > had a sneaking suspicion that infindattr wasn't thread-safe, so I'm
> > convinced this is a bug in the implementation.  One approach might be
> > to store the info in the thread state object
> 
> I don't think this is a good idea -- continuations and coroutines might
> mess it up. Maybe the right thing is to mess with the *compilation* of
> __findattr__ so that it would call __setattr__ and __getattr__ with
> special flags that stop them from calling __findattr__? This is
> ugly, but I can't think of a better way.

Yeah, this is what I tried to say by "different machine state";
compiling different behavior in the case of a special method
is an interesting idea. It is limited somewhat, since the
changed system state is not inherited to called functions.
But if __findattr__ performs its one, single task in its
body alone, we are fine.

still-thinking-of-alternatives - chris

-- 
Christian Tismer             :^)   <mailto:tismer@tismer.com>
Mission Impossible 5oftware  :     Have a break! Take a ride on Python's
Kaunstr. 26                  :    *Starship* http://starship.python.net
14163 Berlin                 :     PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     where do you want to jump today?   http://www.stackless.com