Python Macros

Just just at
Thu Oct 7 00:18:30 CEST 2004

In article <1gl8ciq.sqxbf1q3i6f3N%aleaxit at>,
 aleaxit at (Alex Martelli) wrote:

> G. S. Hayes <sjdevnull at> wrote:
>    ...
> >     def __getattr__(self, attr):
> >         if not hasattr(self, attr):
> redundant: hasattr(self, attr) will ALWAYS be false here, or else
> __getattr__ wouldn't have been entered in the first place.

Worse, hasattr(self, attr) will invoke self.__getattr__()...


More information about the Python-list mailing list