Chris Mellon wrote: > > Nothing so clever. dir() eats and ignores all exceptions, so when you > hit the recursion limit it eats the RecursionLimitExceeded exception > and continues merrily along the way. This is probably not good > behavior... > > class Foo: > def __getattr__(self, attr): > raise SystemExit, "Don't call me, again, ever" > > f = Foo() > f.method() #dies correctly > dir(f) #continues happily
can't understand - what kind of problem you tried to fix in that way? if __getattr__ just raise some exception, it needless to define it at all. -- Maksim Kasimov -- http://mail.python.org/mailman/listinfo/python-list