How to change class instances behavior via reload?

Jürgen Hermann jhe at webde-ag.de
Mon Jun 26 05:02:46 EDT 2000


"Jerome Quelin" <jerome.quelin at insalien.org> schrieb im Newsbeitrag
news:961962342.297785615 at news.libertysurf.fr...
> I would like to change the behavior of all the existing instances of a
> class when using the reload statement. I wonder if this is possible?

Laurent showed you how to do this automatically. Another technique I used to
DETECT whether the implementation of a class has changed is this:

class spam:
    def __init__(self):
        pass

    def checkReload(self):
        return self.__class__ != spam

Bye, Jürgen





More information about the Python-list mailing list