Re: "Super()" confusion

Discussion in 'Python' started by Gabriel Genellina, Feb 10, 2009.

  1. En Mon, 09 Feb 2009 23:34:05 -0200, Daniel Fetchinson
    <> escribió:

    >>>>> Hello. I've been scouring the web looking for something to clear up a
    >>>>> little confusion about the use of "super()" but haven't found
    >>>>> anything
    >>>>> that really helps. Here's my simple example:
    >>>>>
    >>>>> [snip]
    >>>>>
    >>>>> "super(Child,self).__init__(filePath)
    >>>>> TypeError: super() argument 1 must be type, not classobj"
    >>>>>
    >>>>> What have I done wrong? Thanks in advance for any help.
    >>>>
    >>>> Consider whether you really need to use super().
    >>>>
    >>>> http://fuhm.net/super-harmful/
    >>>
    >>> Did you actually read that article, understood it, went through the
    >>> tons of responses from python-dev team members, including Guido

    >>
    >> Yes. Why the knee-jerk reaction?

    >
    > Because throwing around that link carries about the same amount of
    > information as "perl is better than python", "my IDE is better than
    > yours", "vim rulez!", "emacs is cooler than vim", etc, etc.


    Not at all. It contains accurate and valuable information that isn't
    available elsewhere.

    >> I simply pointed out a resource which
    >> might be helpful to someone trying to learn to use super.

    >
    > It will certainly not be helpful to anyone trying to learn the usage
    > of super. The person who wrote that essay is simply misunderstanding
    > the concept, as has been explained countless times by the python dev
    > team. Hence, it only increases confusion, adds to the noise and
    > spreads false alarm.


    AFAIK, all facts appearing in said article are still true (except for 3.x
    which uses a shorter form). If super usage had been clearly documented in
    the first place, this had not happened.
    Perhaps you could point us to some resource explaining how is super
    supposed to be used correctly?
    And of those giving explanations in python-dev, nobody cared to add a
    single word to the Python documentation for years.

    > Honestly, I don't understand how this thing got so much out of
    > control. If anyone starts an intelligent question or remark about
    > super, this essay is thrown in no matter what. Anyone can explain why?


    Because for a very loooooong time (seven years, 2001-2008) super was
    almost undocumented. The Library Reference -before release 2.6- only had a
    short paragraph, the online documentation referred (and still does) to the
    original essay by Guido introducing descriptors, which is inaccurate and
    outdated, and then the "... harmful" article was the only source of
    information available.
    Worse was the fate of packages and how they're imported: nobody "could be
    bothered to spell that out" (sic); or how import works in general, still
    barely documented (one has to dig into the PEP collection, trying to guess
    what parts are truly implemented and what parts are only a wish...)

    --
    Gabriel Genellina
    Gabriel Genellina, Feb 10, 2009
    #1
    1. Advertising

  2. On Feb 10, 4:29 am, "Gabriel Genellina"
    > AFAIK, all facts appearing in said article are still true (except for 3.x  
    > which uses a shorter form). If super usage had been clearly documented in  
    > the first place, this had not happened.
    > Perhaps you could point us to some resource explaining how is super  
    > supposed to be used correctly?
    > And of those giving explanations in python-dev, nobody cared to add a  
    > single word to the Python documentation for years.
    >
    > > Honestly, I don't understand how this thing got so much out of
    > > control. If anyone starts an intelligent question or remark about
    > > super, this essay is thrown in no matter what. Anyone can explain why?

    >
    > Because for a very loooooong time (seven years, 2001-2008) super was  
    > almost undocumented. The Library Reference -before release 2.6- only had a  
    > short paragraph, the online documentation referred (and still does) to the  
    > original essay by Guido introducing descriptors, which is inaccurate and  
    > outdated, and then the "... harmful" article was the only source of  
    > information available.


    All right. This is way I made the effort of writing a comprehensive
    collection of all the tricky points about super
    I knew:

    http://www.artima.com/weblogs/viewpost.jsp?thread=236275
    http://www.artima.com/weblogs/viewpost.jsp?thread=236278
    http://www.artima.com/weblogs/viewpost.jsp?thread=237121

    Also see this thread on python-dev about the issue of super
    documentation: http://www.gossamer-threads.com/lists/python/dev/673833


    Michele Simionato
    Michele Simionato, Feb 10, 2009
    #2
    1. Advertising

  3. En Tue, 10 Feb 2009 03:26:20 -0200, Michele Simionato
    <> escribió:
    > On Feb 10, 4:29 am, "Gabriel Genellina"


    >> > Honestly, I don't understand how this thing got so much out of
    >> > control. If anyone starts an intelligent question or remark about
    >> > super, this essay is thrown in no matter what. Anyone can explain why?

    >>
    >> Because for a very loooooong time (seven years, 2001-2008) super was  
    >> almost undocumented. The Library Reference -before release 2.6- only
    >> had a  
    >> short paragraph, the online documentation referred (and still does) to
    >> the  
    >> original essay by Guido introducing descriptors, which is inaccurate
    >> and  
    >> outdated, and then the "... harmful" article was the only source of  
    >> information available.

    >
    > All right. This is way I made the effort of writing a comprehensive
    > collection of all the tricky points about super
    > I knew:
    >
    > http://www.artima.com/weblogs/viewpost.jsp?thread=236275
    > http://www.artima.com/weblogs/viewpost.jsp?thread=236278
    > http://www.artima.com/weblogs/viewpost.jsp?thread=237121


    You really should push them to be included in python.org, even in their
    unfinished form. (At least a link in the wiki pages). Their visibility is
    almost null now.
    They're very clearly written - I wish you had published them years ago!

    > Also see this thread on python-dev about the issue of super
    > documentation: http://www.gossamer-threads.com/lists/python/dev/673833


    Apart from a few remarks in the first posts, there is little criticism of
    your articles themselves. Looks like adding a section about Python 3 is
    the only important pending issue - again, you really should publish the
    series in a more prominent place.

    --
    Gabriel Genellina
    Gabriel Genellina, Feb 10, 2009
    #3
  4. On Feb 10, 9:19 am, "Gabriel Genellina" <>
    wrote:
    > You really should push them to be included in python.org, even in their  
    > unfinished form. (At least a link in the wiki pages). Their visibility is  
    > almost null now.


    It looks like I made an unfortunate choice with the
    title ("Things to Know about Super"). I have just changed
    it to "Things to Know about *Python* Super" so that now
    googling for "python super" should hopefully find them.

    I agree that the real solution would be to publish on python.org, but
    for that I have to write yet another paper about Python 3.0 super, cut
    things about old version/bugs of Python, re-read the whole beast, and
    convince the core developers to publish it (which is not automatic).
    That is some work, and I have many other projects going on right now.
    Truth is, discussions about super do not come out so often, and most
    people don't care.

    > They're very clearly written - I wish you had published them years ago!


    Me too, but you know what happens when working for free and without
    deadlines ;)

    > again, you really should publish the  
    > series in a more prominent place.


    Soon or later I will go back to super in Python 3.0, but now I am
    working on my Scheme series, I have yet to translate two articles of
    my "Mixins considered harmful" series, and I have at least two other
    articles which has been waiting publication for more than one year.
    Plus, I have a full time job ;)
    But if you and others keep bugging me something may happen ...

    Michele Simionato
    Michele Simionato, Feb 11, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest

    super.super.super how?

    Guest, Feb 19, 2005, in forum: Java
    Replies:
    24
    Views:
    10,737
    Darryl Pierce
    Feb 24, 2005
  2. Fernando Rodriguez

    Getting the super class via the super() function

    Fernando Rodriguez, Nov 21, 2003, in forum: Python
    Replies:
    2
    Views:
    708
    Bob Willan
    Nov 22, 2003
  3. Kerim Borchaev

    super. could there be a simpler super?

    Kerim Borchaev, Jan 15, 2004, in forum: Python
    Replies:
    4
    Views:
    466
    Michele Simionato
    Jan 15, 2004
  4. Replies:
    7
    Views:
    450
    Patricia Shanahan
    Apr 6, 2008
  5. GOOD LUCK GROUP
    Replies:
    0
    Views:
    384
    GOOD LUCK GROUP
    Apr 28, 2008
Loading...

Share This Page