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

paper_Manu #70

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

paper_Manu #70

wants to merge 3 commits into from

Conversation

kmanuponce
Copy link

No description provided.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

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

Well done Manu, this is a solid submission and you hit all the learning goals. I made a few comments, mostly on coding style.

Overall this is great work.

@@ -0,0 +1,11 @@
from swap_meet.item import Item

Choose a reason for hiding this comment

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

👍 Very clean child classes!

@@ -0,0 +1,23 @@
#wave2
class Item(): #parens allow inheritance
def __init__(self, category="", condition=0):

Choose a reason for hiding this comment

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

👍

self.category = category
self.condition = condition

def __str__(self):

Choose a reason for hiding this comment

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

👍

def __str__(self):
return("Hello World!")

def condition_description(self):

Choose a reason for hiding this comment

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

👍

self.inventory = inventory


def add(self, add_item):

Choose a reason for hiding this comment

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

👍

Comment on lines +41 to +42
if len(self.inventory) == 0 or len(friend.inventory) == 0:
return False

Choose a reason for hiding this comment

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

This is a little simpler due to the fact that [] is falsey.

Suggested change
if len(self.inventory) == 0 or len(friend.inventory) == 0:
return False
if not self.inventory or not friend.inventory:
return False

return self.swap_items(friend, my_item, their_item)

#wave6
def get_best_by_category(self, category):

Choose a reason for hiding this comment

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

👍

Comment on lines +64 to +65
#DRYup using swap_items
#return self.swap_items(other, my_item, their_item)

Choose a reason for hiding this comment

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

This would have been a good choice

best_by_category = item
return best_by_category

def swap_best_by_category(self, other, my_priority, their_priority):

Choose a reason for hiding this comment

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

👍

Comment on lines +82 to +103
# if __name__ == "__main__":

# from item import Item
# item1 = Item("jacket")


# x = Vendor()
# print(x.inventory)

# y = Vendor([item1])
# print(y.inventory)

# x.add(1)
# print(x.inventory)

# print (x.remove(3))

# if x.remove(1):
# print("remove 1")

# y.get_by_category("jacket")
# print(y.get_by_category)

Choose a reason for hiding this comment

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

Just consider removing the commented code prior to submitting.

Suggested change
# if __name__ == "__main__":
# from item import Item
# item1 = Item("jacket")
# x = Vendor()
# print(x.inventory)
# y = Vendor([item1])
# print(y.inventory)
# x.add(1)
# print(x.inventory)
# print (x.remove(3))
# if x.remove(1):
# print("remove 1")
# y.get_by_category("jacket")
# print(y.get_by_category)

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