Re: Over(joy)riding

2010-02-17 Thread Bruno Desthuilliers
mk a écrit : > Bruno Desthuilliers wrote: >> mk a écrit : >>> P.S. Method resolution order in Python makes me want to kill small >>> kittens. >> >> mro is only a "problem" when using MI. > > Oh sure! And I have the impression that multiple inheritance is not used > all that often. What (some) Pyth

Re: Over(joy)riding

2010-02-17 Thread Terry Reedy
On 2/17/2010 8:53 AM, mk wrote: Found in Dive into Python: """Guido, the original author of Python, explains method overriding this way: "Derived classes may override methods of their base classes. Because methods have no special privileges when calling other methods of the same object, a method

Re: Over(joy)riding

2010-02-17 Thread mk
Kurt Smith wrote: In case you're not familiar with it, MI allows you to have mixins & traits. They work very well if the mixin superclasses don't have any clashes with the other superclasses, so each mixin adds its own unique set of methods to the derived class. Then you don't have to worry ab

Re: Over(joy)riding

2010-02-17 Thread Kurt Smith
On Wed, Feb 17, 2010 at 9:08 AM, mk wrote: > Bruno Desthuilliers wrote: >> >> mk a écrit : >>> >>> P.S. Method resolution order in Python makes me want to kill small >>> kittens. >> >> mro is only a "problem" when using MI. > > Oh sure! And I have the impression that multiple inheritance is not us

Re: Over(joy)riding

2010-02-17 Thread mk
Bruno Desthuilliers wrote: mk a écrit : P.S. Method resolution order in Python makes me want to kill small kittens. mro is only a "problem" when using MI. Oh sure! And I have the impression that multiple inheritance is not used all that often. What (some) Python code I've read in open sourc

Re: Over(joy)riding

2010-02-17 Thread Bruno Desthuilliers
mk a écrit : P.S. Method resolution order in Python makes me want to kill small kittens. mro is only a "problem" when using MI. -- http://mail.python.org/mailman/listinfo/python-list

Re: Over(joy)riding

2010-02-17 Thread mk
Arnaud Delobelle wrote: Is what I concocted in e.calling_overriden() == what Guido said on base class sometimes calling overriden method instead of its own original method? Yes! For a change I achieved resounding success with Python. :-) P.S. Method resolution order in Python makes me want t

Re: Over(joy)riding

2010-02-17 Thread Arnaud Delobelle
mk writes: > Found in Dive into Python: > > """Guido, the original author of Python, explains method overriding > this way: "Derived classes may override methods of their base > classes. Because methods have no special privileges when calling other > methods of the same object, a method of a base