[Zope-dev] __getattr__ and Acquisition

Lennart Regebro lennart@torped.se
Wed, 25 Sep 2002 12:44:05 +0200


From: "Andreas Kostyrka" <andreas@kostyrka.priv.at>
To: "Lennart Regebro" <lennart@torped.se>
> > You shouldn't, really.

> Why not?

Because that's not how it's supposed to work. You can override __getattr__
to have special magick attributes. Acquisition is not a special magick
attribute. __getattr__ is only called when an attribute aren't found in a
"normal" way, and in the context of Zope, Acquicistion would be regarded as
normal. :-)

> Done. Only thing I've noticed that the Catalog shows this "additional"
> path elements, ...

I guess that depends on when you patch in the extra object in the
acquisition. If you do it in __of__() then I guess it's visible all the
time. This may or may not be a good idea. :)