Skip to content
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

C17 whales - Morgan Adkisson #109

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

MorganAdkisson
Copy link

No description provided.

Copy link

@kaidamasaki kaidamasaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

I left a few style notes but overall everything looks good.

Well done!

Comment on lines +59 to +61
for rec in recommendations:
assert rec['genre'] == 'Intrigue'
assert len(recommendations) == 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These assertions are kind of contradictory since the for loop should never be entered if the list is empty.

Suggested change
for rec in recommendations:
assert rec['genre'] == 'Intrigue'
assert len(recommendations) == 0
assert len(recommendations) == 0

Comment on lines +8 to +16
movie_dict = {}

if title and genre and rating:
movie_dict['title'] = title
movie_dict['genre'] = genre
movie_dict['rating'] = rating
else:
return None
return movie_dict

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generally find it clearer to return a dictionary literal instead of creating an empty dictionary and modifying it:

Suggested change
movie_dict = {}
if title and genre and rating:
movie_dict['title'] = title
movie_dict['genre'] = genre
movie_dict['rating'] = rating
else:
return None
return movie_dict
if title and genre and rating:
return {
'title': title,
'genre': genre,
'rating': rating
}
else:
return None

Comment on lines +27 to +30
for movie_dicts in user_data['watchlist']:
if movie_dicts['title'] == movie:
user_data['watched'].append(movie_dicts)
user_data['watchlist'].remove(movie_dicts)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style: movie_dicts is only a single dict so shouldn't have a plural name:

Suggested change
for movie_dicts in user_data['watchlist']:
if movie_dicts['title'] == movie:
user_data['watched'].append(movie_dicts)
user_data['watchlist'].remove(movie_dicts)
for movie_dict in user_data['watchlist']:
if movie_dict['title'] == movie:
user_data['watched'].append(movie_dict)
user_data['watchlist'].remove(movie_dict)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants