-
-
Save IndhumathyChelliah/a14a0fc29897a4806f1d473bb013b68e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A: | |
def __getmethod(self): | |
print ("Inside Class A") | |
class B(A): | |
def __getmethod(self): | |
print ("Inside Class B") | |
b=B() | |
#Accessing __getmethod() in Class A using Name Mangling | |
b._A__getmethod()#Output:Inside Class A | |
#Accessing __getmethod() in Class B using Name Mangling | |
b._B__getmethod()#Output:Inside Class B |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment