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

Rock- Briyana Haywood #68

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

Conversation

brijhaywood
Copy link

No description provided.

Copy link

@audreyandoy audreyandoy left a comment

Choose a reason for hiding this comment

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

Great job Briyana! You hit all the learning goals. I've seen a great improvement code style since viewing party!

Keep up the good work! 🥳

Comment on lines +2 to +7
class Clothing(Item):
def __init__(self, condition = 0):
self.category = "Clothing"
self.condition = condition
def __str__(self):
return "The finest clothing you could wear."

Choose a reason for hiding this comment

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

To refactor and truly inherit from the Item class, you can use a super() constructor like so:

Suggested change
class Clothing(Item):
def __init__(self, condition = 0):
self.category = "Clothing"
self.condition = condition
def __str__(self):
return "The finest clothing you could wear."
class Clothing(Item):
def __init__(self, condition = 0):
super().__init__(self, category = "Clothing", condition)
def __str__(self):
return "The finest clothing you could wear."

Choose a reason for hiding this comment

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

This same logic can also be used for Decor and Electronics.

Comment on lines +9 to +23
def condition_description(self):
if self.condition == 0:
return "Poor"
elif self.condition <= 1:
return "Fair"
elif self.condition <= 2:
return "Gently Used"
elif self.condition <= 3:
return "Good Condition"
elif self.condition <= 4:
return "Excellent Condition"
elif self.condition <= 5:
return "Like Brand New"
else:
return "Invalid Number"

Choose a reason for hiding this comment

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

This is great! It would also be good to check if condition is expected to be an integer.

for items in list_by_category:
if items.condition > best_item.condition:
best_item = items
return best_item

Choose a reason for hiding this comment

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

Nice 👍

Comment on lines +111 to +113
my_category = other.get_best_by_category(my_priority)
their_category = self.get_best_by_category(their_priority)
return self.swap_items(other, their_category, my_category)

Choose a reason for hiding this comment

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

Great use of helper 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