Perl vs. Python question...
Lloyd Kvam
python at venix.com
Tue Jul 14 17:52:09 EDT 2009
On Tue, 2009-07-14 at 15:32 -0400, Joshua Judson Rosen wrote:
> > The simplistic self.foo = self.compute_foo() will trigger a call to
> > __getattr__, so you can't use that within __getattr__.
>
> That's not true; it *will*, however, trigger a call to __settattr__,
> if it exists; that's what you're thinking of :)
>
> cf. http://docs.python.org/reference/datamodel.html#object.__setattr__
>
> __getattr__, however, is free to just do `self.foo = ...'.
Thanks for the correction.
--
Lloyd Kvam
Venix Corp
DLSLUG/GNHLUG library
http://dlslug.org/library.html
http://www.librarything.com/catalog/dlslug
http://www.librarything.com/rsshtml/recent/dlslug
http://www.librarything.com/rss/recent/dlslug
More information about the gnhlug-discuss
mailing list