-
Notifications
You must be signed in to change notification settings - Fork 103
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
base: main
Are you sure you want to change the base?
Conversation
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.
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 :)
return False | ||
else: | ||
self.remove(my_item) | ||
other_vendor.add(my_item) | ||
other_vendor.remove(their_item) | ||
self.add(their_item) | ||
return True |
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.
Nicely done!
their_newest = min(other_vendor.inventory, key=lambda item: item.age, default=False) |
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.
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!" |
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.
💪 !!!
# 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.") |
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.
I really like your decision to raise errors in these cases. I wonder what the unit tests for these cases would look like 😄 😄 😄
No description provided.