-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Group 3 - refactoring library class #15
base: main
Are you sure you want to change the base?
Conversation
crime_audio_books: list[Book] = [] | ||
max: Optional[Book] = None | ||
|
||
# print banner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commentary not necessary. Does not say "why"
if b._book_type == "Audio": | ||
if max is not None and max.duration < b.duration: | ||
max = b | ||
# end if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# end if
useless as per python
print("********* Longest Crime Audio Book **********") | ||
print("*********************************************") | ||
|
||
for b in self.get_books(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we access _books
directly?
max = b | ||
# end if | ||
# end if | ||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be removed. Same as not having an else
if Genre.CRIME in b.genres: | ||
if b._book_type == "Audio": | ||
if max is not None and max.duration < b.duration: | ||
max = b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is max
ever changed from None
def __init__(self, books: list[Book]): | ||
self._books = books | ||
|
||
_books: list[Book] = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be placed at the top
|
||
class Library(): | ||
|
||
# Prints crime audio books |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment pollution: the function's name already describes what is does
No description provided.