-
Notifications
You must be signed in to change notification settings - Fork 110
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
Cheetahs - Ariam Yonas #100
base: master
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.
Good work, Ariam! 🎉
Nice job with the first five waves; your commit messages are detailed and your code is a breeze to read! Your integration tests for the first three waves pass flawlessly and I see you were making good progress on Wave 5 as well! I would love to see you get more comfortable with writing inheritance and overriding methods since Unit 2 will rely heavily on writing classes. This project is a Yellow. 🟡
Please let me know if I can clear up any concepts or answer questions about the feedback during our 1:1s or office hours! You got this! 💯
def __init__(self, condition = 0): | ||
super().__init__(category="Clothing", condition = condition) |
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.
We use a super dunder init but we forgot to pass in Item
as a parent class on L4!
super().__init__(condition=condition, category="Decor") |
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 constructor here! ✨
return 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 validation check here! 💯
@@ -49,7 +49,9 @@ def test_removing_not_found_is_false(): | |||
|
|||
result = vendor.remove(item) | |||
|
|||
raise Exception("Complete this test according to comments below.") | |||
assert result == 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.
👍🏻
super().__init__(category="Electronics", condition = condition) | ||
|
||
def __str__(self): | ||
return " A gadget full of buttons and secrets." |
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.
Remember that strings are sensitive about whitespace! The space between the first "
and A gadget full of buttons and secrets
makes a test in Wave 5 test_electronics_has_default_category_and_to_str()
fail when it should pass. 😉
return "Hello World!" | ||
|
||
def condition_rank(self): |
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.
Make sure your method names follow the project requirements to pass the tests! Although condition_rank
is a fine name, the test and the readme in Wave 5 wanted condition_description
. If we change the name, the final test in Wave 5 should pass.
|
||
def swap_items(self, friend, my_item, their_item): | ||
if my_item in self.inventory and their_item in friend.inventory: |
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.
Brilliant chained conditionals! Love to see it!
self.inventory.append(their_item) | ||
friend.inventory.remove(their_item) | ||
self.inventory.remove(my_item) |
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.
This works! I also see we created helper methods above, the add()
and remove()
seem useful...
if not self.inventory or not friend.inventory: | ||
return False | ||
return self.swap_items(friend, self.inventory[0], friend.inventory[0]) |
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.
The efficiency! ✨
@@ -33,8 +33,9 @@ def test_get_no_matching_items_by_category(): | |||
) | |||
|
|||
items = vendor.get_by_category("electronics") | |||
assert len(items) == 0 |
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.
Nice!
No description provided.