Created
April 14, 2017 14:55
-
-
Save soar/4958bb0ad49365aa520c26bc0962c983 to your computer and use it in GitHub Desktop.
Python Types
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
| class Test(object): | |
| a = '' | |
| b = {} | |
| def __init__(self, a, b): | |
| self.a = a | |
| self.b.update({b: b}) | |
| def __str__(self): | |
| return "a: {!s}, b: {!s}".format(self.a, self.b) | |
| v1 = Test('v1-a', 'v1-b') | |
| v2 = Test('v2-a', 'v2-b') | |
| print('v1: {!s}'.format(v1)) | |
| print('v2: {!s}'.format(v2)) |
Author
soar
commented
Apr 14, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment