On 1/25/07, Jeremy Dunck <[EMAIL PROTECTED]> wrote: > Well, there are a number of things going on here. >
A demo of not changing existing objects: >>> class X(object): ...: def y(self): ...: return 1 ...: ...: >>> x = X() >>> x.y() 1 >>> x.x() --------------------------------------------------------------------------- exceptions.AttributeError Traceback (most recent call last) .... >>> class X(object): ...: def x(self): ...: return 2 ...: def y(self): ...: return 3 ...: ...: >>> x.y() 1 >>> x.x() --------------------------------------------------------------------------- exceptions.AttributeError Traceback (most recent call last) /home/jdunck/work/pegasus/dytrunk/emmitt/dailyyou/<ipython console> AttributeError: 'X' object has no attribute 'x' ... >>> id(x.__class__) 136002020 >>> id(X) 136875292 >>> y = X() >>> y.x() 2 >>> y.y() 3 >>> id(y.__class__) 136875292 >>> id(X) 136875292 ============================= An object's behavior is determined both by its state (the self.__dict__ attribute) and its class (the self.__class__ attribute). reload() doesn't go change the __class__ of all the objects which were created before reload was called. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---