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 - Abigail C. #65

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

Rock - Abigail C. #65

wants to merge 6 commits into from

Conversation

ChaAbby
Copy link

@ChaAbby ChaAbby commented Apr 7, 2021

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 Abigail! You hit all the learning goals. I added a few comments about inheritance and edge cases.

Well done!

Comment on lines +5 to +6
self.category = "Clothing"
self.condition = condition

Choose a reason for hiding this comment

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

This looks great! You can further refactor this by using super() to inherit the category and condition attributes since Clothing is a child class.

Comment on lines +5 to +6
self.category = "Clothing"
self.condition = condition

Choose a reason for hiding this comment

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

The two lines can be reduced to

Suggested change
self.category = "Clothing"
self.condition = condition
super().__init__("Clothing", condition)

Comment on lines +6 to +7
self.category = "Decor"
self.condition = condition

Choose a reason for hiding this comment

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

Same recommendation as above to use super()

Comment on lines +6 to +7
self.category = "Electronics"
self.condition = condition

Choose a reason for hiding this comment

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

Beating a dead horse but same as above about super()

Comment on lines +6 to +7
self.category = category
self.condition = condition

Choose a reason for hiding this comment

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

Is condition always going to be an integer? A way to make your code more robust is to also check if condition is the correct data type you're expecting. What about float values or strings?

'''
reassigns the stringified item
'''
return "Hello World!"

Choose a reason for hiding this comment

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

nice! 👍

Comment on lines +20 to +34
if self.condition == 5:
five_condition_description = "Great Condition"
return five_condition_description
elif self.condition == 4:
four_condition_description = "Good Condition"
return one_condition_description
elif self.condition == 3:
three_condition_description = "Okay Condition"
return one_condition_description
elif self.condition == 2:
two_condition_description = "Poor Condition"
return one_condition_description
elif self.condition == 1:
one_condition_description = "Very Poor Condition"
return one_condition_description

Choose a reason for hiding this comment

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

One good thought exercise is how mighty our conditionals change if condition was a float?

Comment on lines +55 to +63
for item in other_vendor.inventory:
if item == other_vendor_item:
self.inventory.append(item)
other_vendor.inventory.remove(item)
for item in self.inventory:
if item == vendor_item:
other_vendor.inventory.append(item)
self.inventory.remove(item)
return True

Choose a reason for hiding this comment

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

Nice! 👍

if item.condition > largest_num:
largest_num = item.condition
largest_item = item
return largest_item

Choose a reason for hiding this comment

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

Great job! 👍

vendor_item = other.get_best_by_category(my_priority)
other_item = self.get_best_by_category(their_priority)
self.swap_items(other, other_item, vendor_item)

Choose a reason for hiding this comment

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

great use of other 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