Replace Whole Object Through Object Method

digitalorganics at gmail.com digitalorganics at gmail.com
Tue Jul 4 13:18:44 EDT 2006


Fredrik Lundh wrote:
> digitalorganics at gmail.com 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 ?

Why not just do what? And the way you use the term abuse, almost as if
Python's class mechanism was someone's child...

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




More information about the Python-list mailing list