-
-
Save anonymous/3011b631b3e742f9fd0a44559a589d29 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 StringHolder: | |
def __init__(self, val): | |
self.val = val | |
def __str__(self): | |
return str(self.val) | |
def __repr__(self): | |
return self.val | |
name = StringHolder('Morgan') | |
url = StringHolder('github.com') | |
data = [name, url] | |
print(data) | |
name.val = 'Morgan Thrapp' | |
print(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment