Skip to content

Instantly share code, notes, and snippets.

@srinivasreddy
Last active December 16, 2015 19:49
Show Gist options
  • Select an option

  • Save srinivasreddy/5487635 to your computer and use it in GitHub Desktop.

Select an option

Save srinivasreddy/5487635 to your computer and use it in GitHub Desktop.

Revisions

  1. srinivasreddy revised this gist Apr 30, 2013. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions inheritance.py
    Original file line number Diff line number Diff line change
    @@ -7,12 +7,14 @@ class B(A):
    class C(B):
    pass

    This example shows multi-level inheritance,
    #The above example shows multi-level inheritance,

    class A(object): pass

    class B(object):pass

    class C(A,B):pass

    If a single class inherits from two or more classes then it is called Multiple inheritance.
    #The above example shows multiple inheritance.

    #If a single class inherits from two or more classes then it is called Multiple inheritance.
  2. srinivasreddy revised this gist Apr 30, 2013. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions inheritance.py
    Original file line number Diff line number Diff line change
    @@ -15,5 +15,4 @@ class B(object):pass

    class C(A,B):pass


    This example shows multiple inheritance.
    If a single class inherits from two or more classes then it is called Multiple inheritance.
  3. srinivasreddy created this gist Apr 30, 2013.
    19 changes: 19 additions & 0 deletions inheritance.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    class A(object):
    pass

    class B(A):
    pass

    class C(B):
    pass

    This example shows multi-level inheritance,

    class A(object): pass

    class B(object):pass

    class C(A,B):pass


    This example shows multiple inheritance.