Skip to content

Instantly share code, notes, and snippets.

@FerdinaKusumah
Last active December 21, 2019 16:06
Show Gist options
  • Save FerdinaKusumah/37281231d6ff8edcc8bbf0a04b289800 to your computer and use it in GitHub Desktop.
Save FerdinaKusumah/37281231d6ff8edcc8bbf0a04b289800 to your computer and use it in GitHub Desktop.
Underscore Python
class ManglingTest:
def __init__(self):
self.__mangled = 'hello'
def get_mangled(self):
return self.__mangled
>>> ManglingTest().get_mangled()
'hello'
>>> ManglingTest().__mangled
AttributeError: "'ManglingTest' object has no attribute '__mangled'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment