Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Alan Meyer Newsgroups: comp.lang.python Subject: Re: Composition instead of inheritance Date: Mon, 02 May 2011 13:30:02 -0400 Organization: A noiseless patient Spider Lines: 23 Message-ID: <4DBEEA1A.6000004@yahoo.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: mx02.eternal-september.org; posting-host="cXfoUdE2tOmL54C/tFXK/Q"; logging-data="18055"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Nm9LtqBRB9joWQOSFTL2i" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 In-Reply-To: Cancel-Lock: sha1:YEGBVaLjwsoow9Wz4UBAEFkAD0E= Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:4487 On 4/28/2011 1:15 PM, Ethan Furman wrote: > For anybody interested in composition instead of multiple inheritance, I > have posted this recipe on ActiveState (for python 2.6/7, not 3.x): > > http://code.activestate.com/recipes/577658-composition-of-classes-instead-of-multiple-inherit/ > > > Comments welcome! > > ~Ethan~ That looks pretty clever. I tried adding this method to Spam: def test_eggs_02(self): print('testing eggs_02 from spam') and it did just what we wanted. I'm going to have to study this one. Thanks. Alan