[EMAIL PROTECTED] wrote: > I have tried this, with Psyco it segfaults, and with Python 2.5 (on > Win) hangs the interpreter, is it possible to improve the situation? > > class T(object): > def __getattr__(self, x): dir(self) > #import psyco > #psyco.full() > T().method() > > (Probably dir calls __getattr__). > > Bye, > bearophile >
how to improve the situation depends on what do you expect to get by calling "T().method()" dir calls __getattr__ with the value '__members__', for example you can write: def __getattr__(self, x): if x == '__members__': return ('method1', 'field1', ) -- Maksim Kasimov -- http://mail.python.org/mailman/listinfo/python-list