Re: understanding the mro (long)

2010-07-24 Thread Carl Banks
On Jul 23, 7:42 pm, Rolando Espinoza La Fuente wrote: > TL;DR: if you want to stay sane, don't inherit two classes that share > same inheritance graph [snip rest] If you want to stay sane, don't inherit from ANY class unless A. you own it, or B. it's explicitly documented as supporting inherita

Re: understanding the mro (long)

2010-07-23 Thread Michele Simionato
On Jul 24, 4:42 am, Rolando Espinoza La Fuente wrote: > Finally everything make sense. And make think about be careful when > doing multiple inheritance. > > Any thoughts? > > ~Rolando I am not fond of multiple inheritance either and I wrote at length about the dangers of it. If you do not know i

Re: understanding the mro (long)

2010-07-23 Thread Rolando Espinoza La Fuente
On Sat, Jul 24, 2010 at 12:28 AM, Benjamin Kaplan wrote: [...] > > And second, not to in any way diminish the work you did tracing out > the inheritance tree and working through the inheritance, but Python > has easier ways of doing it :) > BBar.__mro__ > (, , 'exceptions.RuntimeError'>, ,

Re: understanding the mro (long)

2010-07-23 Thread Benjamin Kaplan
On Fri, Jul 23, 2010 at 7:42 PM, Rolando Espinoza La Fuente wrote: > TL;DR: if you want to stay sane, don't inherit two classes that share > same inheritance graph > > I recently got puzzled by a bug from a legacy lib (ClientForm) > which have this code: > >    class ParseError(sgmllib.SGMLParseEr

Re: understanding the mro (long)

2010-07-23 Thread Steven D'Aprano
On Fri, 23 Jul 2010 22:42:28 -0400, Rolando Espinoza La Fuente wrote: > TL;DR: if you want to stay sane, don't inherit two classes that share > same inheritance graph > > I recently got puzzled by a bug from a legacy lib (ClientForm) which > have this code: [...] > Finally everything make sense.

understanding the mro (long)

2010-07-23 Thread Rolando Espinoza La Fuente
TL;DR: if you want to stay sane, don't inherit two classes that share same inheritance graph I recently got puzzled by a bug from a legacy lib (ClientForm) which have this code: class ParseError(sgmllib.SGMLParseError, HTMLParser.HTMLParseError, ):