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

Sapphire - April Zhang #68

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

Sapphire - April Zhang #68

wants to merge 21 commits into from

Conversation

aruaaa17
Copy link

@aruaaa17 aruaaa17 commented Apr 7, 2023

No description provided.

Copy link

@tildeee tildeee left a comment

Choose a reason for hiding this comment

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

Great work on this project, April! This project is marked as a "green" on my end.

Overall, this is a fantastic project submission. Your code practices good OOP practices, inheritance, using instance methods, and everything else I was looking for. Not only that, but your code style is consistent, clear, and concise. You used max and min in really good opportunities too. Keep doing what you're doing!

Your git hygiene looks pretty good, keep doing frequent commits and descriptive commit messages. Lastly, your tests look great too!

Good work, let me know if you have any questions.

EDIT: Also, great work with the optional enhancements :)

Comment on lines +52 to +59
return False
else:
self.remove(my_item)
other_vendor.add(my_item)
other_vendor.remove(their_item)
self.add(their_item)
return True
Copy link

Choose a reason for hiding this comment

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

Nicely done!

Comment on lines +124 to +125
their_newest = min(other_vendor.inventory, key=lambda item: item.age, default=False)
Copy link

Choose a reason for hiding this comment

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

Nicely done!

return "This item still has plenty of life left and character to spare."
elif self.condition == 3:
return "It's not down for the count - it's still got some fight left in it!"
Copy link

Choose a reason for hiding this comment

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

💪 !!!

Comment on lines +16 to +22
# when id is not provided, generate an id with integer.
else:
self.id = uuid.uuid4().int
# If condition out of range, raise ValueError.
if condition > 5:
raise ValueError("Condition value range from 0 to 5.")
Copy link

Choose a reason for hiding this comment

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

I really like your decision to raise errors in these cases. I wonder what the unit tests for these cases would look like 😄 😄 😄

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