-
Notifications
You must be signed in to change notification settings - Fork 590
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
Sea Turtles - Heather M. #14
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.
Heather this was a great approach to the swap meet project! Your code was clean, efficient, and readable. I left a few comments on things you did great and things you can refactor. Let me know if you have any questions.
from swap_meet.item import Item | ||
|
||
class Clothing(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.
👍🏽
from swap_meet.item import Item | ||
|
||
class Decor(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.
👍🏽
pass | ||
from swap_meet.item import Item | ||
|
||
class Electronics(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.
👍🏽
CATEGORIES = { | ||
"": "Hello World!", | ||
"Clothing": "The finest clothing you could wear.", | ||
"Decor": "Something to decorate your space.", | ||
"Electronics": "A gadget full of buttons and secrets.", | ||
} | ||
|
||
CONDITION_DESCRIPTORS = { | ||
0: "Oof. Are you sure you want this?", | ||
1: "Wow. It's pretty bad.", | ||
2: "Significant damage.", | ||
3: "Needs some love.", | ||
4: "Minor signs of wear or damage.", | ||
5: "So good it might be a scam.", | ||
} |
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.
Heather great job making these global "constant" variables. This helps eliminate redundant code blocks and makes this accessible to other subclasses.
self.category = category | ||
self.condition = condition | ||
|
||
def __str__(self): | ||
return CATEGORIES[self.category] | ||
|
||
def condition_description(self): | ||
return CONDITION_DESCRIPTORS[int(self.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.
👍🏽
vendor.inventory[their_item_index], self.inventory[my_item_index] = swap_items |
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 on this streamlined approach. The add
and remove
methods are now just taking up space. I understand that you technically need them to pass the tests but just wanted to make that note.
my_item = self.inventory[0] | ||
their_item = vendor.inventory[0] | ||
self.swap_items(vendor, my_item, their_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.
great use of your previously created method.
return False | ||
|
||
def get_best_by_category(self, category): |
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.
👍🏽
their_item = other.get_best_by_category(my_priority) |
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 previously used methods.
No description provided.