On Sun, Jun 23, 2013 at 11:08 AM, Ian Kelly <ian.g.ke...@gmail.com> wrote:
> On Sun, Jun 23, 2013 at 10:49 AM, Roy Smith <r...@panix.com> wrote:
>> am I missing something here?
>
> Yes, you're missing that super() does not simply call the base class,
> but rather the next class in the MRO for whatever the type of the
> "self" argument is.  If you write the above as:

Incidentally, although super() is useful, it's not perfect, and this
is one of my grievances with it: that a user can, based upon the name,
draw an inaccurate assumption about what it does without reading or
fully understanding the documentation on it, which might then result
in misusing it.  There might still be some code I wrote out there from
when I first started using Python that looks something like:

    def __init__(self):
        super(Base, self).__init__()
        Mixin.__init__(self)

Which is simply wrong, wrong, wrong.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to