Replace Whole Object Through Object Method

Fredrik Lundh fredrik at
Tue Jun 27 08:04:29 CEST 2006

digitalorganics at wrote:

> I'm working with a team that's doing social modeling, and for example,
> I need to model workers that at some point in the program may or may
> not also become employers. Now, I want the workers to take on all
> behaviors and attributes of an employer in addition to their
> pre-existing "worker" behaviors and attributes. Also, as I'm sure you
> guessed, the workers' attributes need to retain their values at that
> point in the program, so a brand new worker-employer object wouldn't in
> itself do the trick.

so why not just do that, instead of trying to come up with overly 
convoluted ways to abuse a class mechanism that you don't fully understand ?

I suspect that your team would prefer if you got your inspiration from 
GoF instead of Goldberg.


More information about the Python-list mailing list