Bruno Desthuilliers wrote: > neoedmund wrote: > (*PLEASE* stop top-posting - corrected) > > > > Ben Finney wrote: > >> [Please don't top-post above the text to which you're replying.] > >> > >> "neoedmund" <[EMAIL PROTECTED]> writes: > >> > >>> I'm trying to achieve a higher level of "reusability". Maybe it > >>> cannot be done in python? Can anybody help me? > >> What, specifically, are you trying to achieve? What problem needs > >> solving? > > > python use multiple inheritance. > > but "inheritance" means you must inherite all methods from super type. > > now i just need "some" methods from one type and "some" methods from > > other types, to build the new type. > > Do you think this way is more flexible than tranditional inheritance? > > While dynamically adding attributes (and methods - which are attributes > too) is not a problem, I'd second Gregor's anwser : it might be better > to use composition/delegation here. >
Could you show some code to help me know how composition/delegation can be done here? Thanks. -- http://mail.python.org/mailman/listinfo/python-list