Skip to content
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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Sea Turtles - Heather M. #14

wants to merge 5 commits into from

Conversation

cathos
Copy link

@cathos cathos commented Apr 8, 2022

No description provided.

Copy link

@tgoslee tgoslee left a 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):
Copy link

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):
Copy link

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):
Copy link

Choose a reason for hiding this comment

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

👍🏽

Comment on lines +4 to +18
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.",
}
Copy link

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.

Comment on lines +21 to +29
self.category = category
self.condition = condition

def __str__(self):
return CATEGORIES[self.category]

def condition_description(self):
return CONDITION_DESCRIPTORS[int(self.condition)]
Copy link

Choose a reason for hiding this comment

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

👍🏽

Comment on lines +46 to +47
vendor.inventory[their_item_index], self.inventory[my_item_index] = swap_items
Copy link

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)
Copy link

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):
Copy link

Choose a reason for hiding this comment

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

👍🏽

Comment on lines +88 to +89
their_item = other.get_best_by_category(my_priority)
Copy link

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.

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