Skip to content

Maple - Ayaka#77

Open
ayaka wants to merge 13 commits into
Ada-C16:masterfrom
ayaka:master
Open

Maple - Ayaka#77
ayaka wants to merge 13 commits into
Ada-C16:masterfrom
ayaka:master

Conversation

@ayaka

@ayaka ayaka commented Oct 1, 2021

Copy link
Copy Markdown

No description provided.

@spitsfire spitsfire left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

good work, Ayaka!! I like how you solved returning the item with the best condition! Well done!

Comment thread swap_meet/clothing.py
Comment on lines +5 to +6
def __init__(self, condition=0, age=0):
super().__init__("Clothing", condition, age)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍 good idea hardcoding "clothing" here since that will never change if you are creating an instance of Clothing!

Comment thread swap_meet/decor.py
from .item import Item


class Decor(Item):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread swap_meet/electronics.py
from .item import Item


class Electronics(Item):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread swap_meet/item.py
@@ -1,2 +1,25 @@
class Item:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread swap_meet/item.py
Comment on lines +24 to +25
item = Item()
print(item) No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

are you testing that the instance worked? Remember to get rid of any testing or debugging for your final submission

Suggested change
item = Item()
print(item)

Comment thread swap_meet/vendor.py
items = self.inventory
return max(items, key=attrgetter("condition"), default=None)

def get_best_by_category(self, category):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread swap_meet/vendor.py
"""
if items is None:
items = self.inventory
return min(items, key=attrgetter("category"), default=None)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

did you mean "age" here?

Suggested change
return min(items, key=attrgetter("category"), default=None)
return min(items, key=attrgetter("age"), default=None)

Comment thread swap_meet/vendor.py
items = self.inventory
return min(items, key=attrgetter("category"), default=None)

def swap_by_newest(self, other):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread swap_meet/vendor.py
item_to_receive = other.get_newest()
return self.swap_items(other, item_to_give, item_to_receive)

def get_newest_by_category(self, category):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread swap_meet/vendor.py
items = self.get_by_category(category)
return self.get_newest(items)

def swap_newest_by_category(self, other, category):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

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