Skip Montanaro a écrit : >>> In this case there was a bug. Depending on inputs, sometimes obj >>> initialized to a class, sometimes an instance of that class. (I fixed >>> that too while I was at it.) The problem was that the use of __call__ >>> obscured the underlying bug by making the instance as well as the class >>> callable. > >> I don't quite get the point here. A concrete example would be welcome. > > The bug went something like this: > > obj = some.default_class > ... > if some_other_rare_condition_met: > ... several lines ... > obj = some.other_class() > ... > > Later, > > x = obj() > x(...)
Ok, I see. A nasty one, indeed. -- http://mail.python.org/mailman/listinfo/python-list