[Python-Dev] Error in Python Tutorial on Multiple Inheritence

Josiah Carlson jcarlson at uci.edu
Thu Aug 12 07:41:42 CEST 2004


> > If so, maybe that paragraph should be rewritten to make
> > it more clear. With an example like the above, perhaps?
> 
> Can you provide a patch? Please upload to sf.net/projects/python.

Perhaps the following example (or a variant) should be included in the
tutorial as an example.

>>> class a:
...     x = 0
...
>>> class b(a):
...     x = 1
...
>>> class c(a):
...     pass
...
>>> class d(a,b):
...     pass
...
>>> class e(b,a):
...     pass
...
>>> d().x
0
>>> e().x
1


 - Josiah



More information about the Python-Dev mailing list