can someone explain 'super' to me?
gagsl-py2 at yahoo.com.ar
Tue Dec 8 19:55:51 CET 2009
En Sat, 05 Dec 2009 07:27:54 -0300, Michael <michaelmossey at yahoo.com>
>> From the docs about the built-in function super:
> super( type[, object-or-type])
> Return the superclass of type. [...]
You won't get anywhere from the docs in this case, unfortunately. Start by
reading these three articles by Michele Simionato:
and also the famous "Python super() considered harmful":
> It seems like it can return either a class or an instance of a class.
> super( C, self)
> is like casting self as superclass C.
Not really - I hope you'll understand what that means after reading the
above articles, feel free to ask again then.
> However if you omit the second argument entirely you get a class.
Those "unbound" super objects are rare; you probably won't need them.
They're discussed in M.S. article, though.
More information about the Python-list