Skip to content

Sapphire - April Zhang#68

Open
aruaaa17 wants to merge 21 commits into
Ada-C19:mainfrom
aruaaa17:main
Open

Sapphire - April Zhang#68
aruaaa17 wants to merge 21 commits into
Ada-C19:mainfrom
aruaaa17:main

Conversation

@aruaaa17

@aruaaa17 aruaaa17 commented Apr 7, 2023

Copy link
Copy Markdown

No description provided.

@tildeee tildeee left a comment

Copy link
Copy Markdown

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 thread swap_meet/vendor.py
Comment on lines +52 to +59
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nicely done!

Comment thread swap_meet/vendor.py
Comment on lines +124 to +125
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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nicely done!

Comment thread swap_meet/item.py
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!"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💪 !!!

Comment thread swap_meet/item.py
Comment on lines +16 to +22
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.")

Copy link
Copy Markdown

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