"Joel Goldstick" <joel.goldst...@gmail.com> wrote
   def __getattr__(self, attr):
       # Fake a __getstate__ method that resturns None
       if attr == "__getstate__":
           return lambda: None

why not "return None"?


       return self[attr]

Oops, too quick. I neant to add:

But this line seems to return a value so the return values of this function seem to be incompatible which is not a good design pattern.

If attr is getstate it returns a function object.
Otherwise it returns whatever the dict holds - Unless the dict holds functions of course.

Alan G.

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to