Skip to content

Instantly share code, notes, and snippets.

@michaelpomogajko
Created July 19, 2018 10:32
Show Gist options
  • Save michaelpomogajko/513a8a98b912a9d59bfe004524b4b083 to your computer and use it in GitHub Desktop.
Save michaelpomogajko/513a8a98b912a9d59bfe004524b4b083 to your computer and use it in GitHub Desktop.
pyhton object repr
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