Skip to content

Commit 69a36b9

Browse files
committed
move new book over
1 parent a8143f5 commit 69a36b9

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎python/09-objects-io.py‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@ def __init__(self, title, pages):
66
self.pages = pages
77

88
def is_short(self):
9-
if self.pages < 100:
10-
return true
9+
return self.pages < 100
1110

1211
#What happens when you pass object to print?
1312
def __str__(self):
1413
return f"{self.title}, {self.pages} pages long"
1514

1615
#What happens when you use ==?
1716
def __eq__(self, other):
18-
if(self.title == other.title and self.pages == other.pages):
19-
return True
17+
return self.title == other.title and self.pages == other.pages
2018

2119
#It's approriate to give something for __hash__ when you override __eq__
2220
# #This is the recommended way if mutable (like it is here):

0 commit comments

Comments
 (0)