"casting" Python objects

djw dwelch91 at attbi.com
Wed May 22 23:39:26 EDT 2002


> Here's an alternative approach you might want to ponder. Instead
> of subclassing jabber.Message, and creating an is-a relation,
> why not use a has-a relation instead and use a class that *has*
> a jabber.Message as an attribute?


I think we have a winner! This seems like the most sane way to proceed short
of hacking into jabber.py. (I just talked to a friend of mine and he asked
me why jabber.py doesn't use a Factory pattern to create its objects? Hmmm.
Is that worth suggesting to the jabber.py authors?)

Thanks,
D







More information about the Python-list mailing list