Mega Code Archive

 
Categories / Python Tutorial / Class
 

Simple Attribute Lookup Example

class P1:      def foo(self):         print 'called P1-foo()' class P2:      def foo(self):         print 'called P2-foo()'     def bar(self):         print 'called P2-bar()' class C1(P1, P2):        pass class C2(P1, P2):        def bar(self):         print 'called C2-bar()' class GC(C1, C2):        pass             # issubclass() determines if one class is a subclass or descendant of another class.  # It has the following syntax: issubclass(sub, sup)