understanding the mro (long)

Carl Banks pavlovevidence at gmail.com
Sat Jul 24 15:23:38 EDT 2010


On Jul 23, 7:42 pm, Rolando Espinoza La Fuente <dark... at gmail.com>
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 inheritance

Furthermore, if you want to stay sane, don't mulitply inherit from any
class unless

A. you own it, or
B. it's explicitly documented as supporting MULTIPLE inheritance


Inheritance is always risky if you don't know what you're inheriting
from.


Carl Banks



More information about the Python-list mailing list