Created
July 19, 2018 10:32
-
-
Save michaelpomogajko/513a8a98b912a9d59bfe004524b4b083 to your computer and use it in GitHub Desktop.
pyhton object repr
This file contains hidden or 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
def __repr__(self): | |
args = ['{}={}'.format(k, repr(v)) for (k,v) in vars(self).items()] | |
return 'ClassName({})'.format(', '.join(args)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment