Threading.py Class Syntax and Super

Michele Simionato michele.simionato at gmail.com
Wed Sep 16 07:35:36 EDT 2009


On Sep 16, 12:23 pm, Casey <casey.mcgi... at gmail.com> wrote:
> Hi,
>
> I noticed that the many (if not all) classes in threading.py[1] all
> inherit from object, yet non of the init methods call super(). I am
> curious as to why this is the chosen implementation? If the benefit of
> new-style classes is to support multiple inheritance, then isn't this
> "broken" if the class __init__ method does not make a call to super?
>
> [1]http://svn.python.org/view/python/trunk/Lib/threading.py?view=markup
>
> Thanks,
> - Casey

You can use multiple inheritance even without using super. Of course,
you lose
is the possibility to make cooperative methods, but this is not
necessarily a
bad thing. A lot of people just do not care about multiple inheritance
and
cooperative methods. Google for "python super" and you will find more
info
than you ever wanted to know.



More information about the Python-list mailing list