Skip to content

Instantly share code, notes, and snippets.

@evandixon
Created December 15, 2020 21:22
Show Gist options
  • Save evandixon/9465da1fa681b3830bafd5df31af7500 to your computer and use it in GitHub Desktop.
Save evandixon/9465da1fa681b3830bafd5df31af7500 to your computer and use it in GitHub Desktop.
Private variables in Python are a mere suggestion
class privateData:
def __init__(self):
self.__whatever__ = "The Good Value"
def doTheThing(self):
print(self.__whatever)
private = privateData()
privateData._privateData__whatever = "The bad value"
privateData.doTheThing(private)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment