]> granicus.if.org Git - python/commit
Add 'super', another new object type with magical properties.
authorGuido van Rossum <guido@python.org>
Fri, 24 Aug 2001 16:47:00 +0000 (16:47 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 24 Aug 2001 16:47:00 +0000 (16:47 +0000)
commit705f0f5a91fec6f4edaa2d8fd4faf17d75c4700c
treee9acd5a916243681ed93b5a4b1596d306c99914f
parent76f0cb85c2269e61a8e31c1d5133975ecef3ec70
Add 'super', another new object type with magical properties.

super(type) -> unbound super object
super(type, obj) -> bound super object; requires isinstance(obj, type)

Typical use to call a cooperative superclass method:

class C(B):
    def meth(self, arg):
        super(C, self).meth(arg);
Objects/typeobject.c