Skip to content

Commit 2dc539b

Browse files
committed
testing for value based equality with dataclass.
1 parent 6f00188 commit 2dc539b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Sprint5/data-class.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def is_adult(self):
1919

2020

2121
p1 = Person("Sara", date(1996, 10, 28), "macOS")
22-
print(p1.is_adult()) # True
22+
print(p1)
2323

24-
p2 = Person("Muhib", date(2018, 6, 22), "Linux")
25-
print(p2.is_adult()) # False
24+
p2 = Person("Sara", date(1996, 10, 28), "macOS")
25+
print(p1 == p2)

0 commit comments

Comments
 (0)