Sapphire - April Zhang#68
Conversation
There was a problem hiding this comment.
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 :)
| if my_item not in self.inventory or their_item not in other_vendor.inventory: | ||
| return False | ||
| else: | ||
| self.remove(my_item) | ||
| other_vendor.add(my_item) | ||
| other_vendor.remove(their_item) | ||
| self.add(their_item) | ||
| return True |
| my_newest = min(self.inventory, key=lambda item: item.age, default=False) | ||
| their_newest = min(other_vendor.inventory, key=lambda item: item.age, default=False) |
| elif self.condition == 4: | ||
| 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!" |
| raise TypeError("Id must be an integer.") | ||
| # 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.
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.