-
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 - Angie Contreras C19 #70
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, Angie! This project is marked as a "green" on my end.
Overall, your code demonstrated great understanding of OOP, instance methods, and inheritance. Your code was logical, clean, and efficient. In addition, your optional enhancements on the project are great-- Great work on the newest
features and the tests for it.
I wish I had more specific feedback for you, but overall all I would say is to keep it up, and let me know if there are any questions!
As a small note, your git hygiene is good, and I'd prefer if the commit messages were more descriptive of the code changes within the commit (for example, "implements swap_items feature" or "handles empty inventories in swap_items" etc)
Great work overall!
other_vendor.add(item_to_other_vendor) | ||
|
||
item_from_other_vendor_to_me = other_vendor.remove(their_item) | ||
self.add(item_from_other_vendor_to_me) |
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 that you used the return value of remove
(item_to_other_vendor
and item_from_other_vendor_to_me
)! I think it's a good pattern.
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.
Thank you! I have to admit I was super confused throughout the project with the name of parameters and variables but I'm happy that at the end I understood the concepts and usage of these parameters inside my methods.
my_first_item = self.inventory[0] | ||
|
||
self.swap_items(other_vendor, my_first_item, first_item_from_friend) |
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 using the swap_items
instance method.
item_other_want = self.get_best_by_category(their_priority) | ||
|
||
return self.swap_items(other_vendor, item_other_want, item_I_want) |
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 job return
ing the value of swap_items
-- you utilized the fact that swap_items
will return True
/False
for you :)
return None | ||
|
||
return min(items_from_category, key=lambda item: item.age) |
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 use of min
and max
throughout!
assert item_f in jesse.inventory | ||
|
||
|
||
def test_swap_by_newest_item_no_inventory_is_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.
Great work on these swap_by_newest
tests!
No description provided.