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

Cedar - Mac Madison #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

mac-madison
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!

Really just one comment on style but overall your code is really elegant and easy to read!

Comment on lines +5 to +9
"""
Returns:
new_movie (dict): A dictionary initialized with title (str), genre (str), and rating (float).
Returns None if any parameters are falsy.
"""

Choose a reason for hiding this comment

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

Nice docstrings!

user_data (dict): The updated user_data with movie added to "watched" and movie removed from "watchlist".
"""

watch_list = user_data.get("watchlist")

Choose a reason for hiding this comment

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

Nice use of get! 😃

Comment on lines +12 to +13
new_movie = {"title": title, "genre": genre, "rating": rating}
return new_movie

Choose a reason for hiding this comment

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

Generally if I'm going to return it on the next line I don't assign to a variable:

Suggested change
new_movie = {"title": title, "genre": genre, "rating": rating}
return new_movie
return {"title": title, "genre": genre, "rating": rating}

Comment on lines +81 to +88
def get_user_titles(user_data):
"""
Returns:
user_titles (set): A set containing all movie titles in user's "watched" list.
"""

user_titles = set([movie.get("title") for movie in user_data.get("watched")])
return user_titles

Choose a reason for hiding this comment

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

Nice helper function. 😃

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