__getattr__ possible loop

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Thu Dec 28 09:06:19 EST 2006


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




More information about the Python-list mailing list