Created
June 23, 2020 08:00
-
-
Save eriky/6495b034865efc9aca8a290319e4631e 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
@attrs | |
class Person(object): | |
name = attrib(default='John') | |
surname = attrib(default='Doe') | |
age = attrib(init=False) | |
p = Person() | |
print(p) | |
p = Person('Bill', 'Gates') | |
p.age = 60 | |
print(p) | |
# Output: | |
# Person(name='John', surname='Doe', age=NOTHING) | |
# Person(name='Bill', surname='Gates', age=60) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment