Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: "Super()" confusion

Reply
Thread Tools

Re: "Super()" confusion

 
 
Gabriel Genellina
Guest
Posts: n/a
 
      02-10-2009
En Mon, 09 Feb 2009 23:34:05 -0200, Daniel Fetchinson
<(E-Mail Removed)> 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-200 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

 
Reply With Quote
 
 
 
 
Michele Simionato
Guest
Posts: n/a
 
      02-10-2009
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-200 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/viewpo...?thread=236275
http://www.artima.com/weblogs/viewpo...?thread=236278
http://www.artima.com/weblogs/viewpo...?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
 
Reply With Quote
 
 
 
 
Gabriel Genellina
Guest
Posts: n/a
 
      02-10-2009
En Tue, 10 Feb 2009 03:26:20 -0200, Michele Simionato
<(E-Mail Removed)> 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-200 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/viewpo...?thread=236275
> http://www.artima.com/weblogs/viewpo...?thread=236278
> http://www.artima.com/weblogs/viewpo...?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

 
Reply With Quote
 
Michele Simionato
Guest
Posts: n/a
 
      02-11-2009
On Feb 10, 9:19*am, "Gabriel Genellina" <(E-Mail Removed)>
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mozilla & Firefox Confusion listsubscriber@hotmail.com Firefox 9 01-20-2005 05:09 PM
Confusion about location of Mozilla files (Mandrake Linux 10.0) Hallvard Tangeraas Firefox 0 09-14-2004 09:46 AM
Procedures in testbench confusion Peter Hermansson VHDL 2 08-25-2004 02:15 PM
confusion when resetting registers martin f. krafft VHDL 2 08-19-2004 06:29 AM
defined() confusion Chris Perl 2 12-18-2003 06:06 PM



Advertisments