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 - Dani Sanchez #52

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

Conversation

danisandiaz
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 Dani, this submission was darn near flawless. I couldn't find much to comment on here. I made a few suggestions on style, but otherwise this is excellent work. Well done.

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

class Clothing(Item):

Choose a reason for hiding this comment

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

👍 Very clean child class

@@ -0,0 +1,32 @@


class Item:

Choose a reason for hiding this comment

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

👍


class Vendor:

def __init__(self, inventory = None):

Choose a reason for hiding this comment

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

👍

return new_item

#removes item_to_remove from self's inventory
def remove(self, item_to_remove):

Choose a reason for hiding this comment

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

👍

return item_to_remove
return False

def get_by_category(self, category):

Choose a reason for hiding this comment

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

👍

items_list.append(item)
return items_list

def swap_items(self, vendor_friend, my_item, their_item):

Choose a reason for hiding this comment

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

👍



def swap_first_item(self, vendor_friend):
if len(self.inventory) != 0 and len(vendor_friend.inventory) != 0:

Choose a reason for hiding this comment

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

This type of thing can be simplified a bit because [] is falsey.

Suggested change
if len(self.inventory) != 0 and len(vendor_friend.inventory) != 0:
if not self.inventory and not vendor_friend.inventory:

return True
return False

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.

👍

return best_condition_item
return None

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.

👍

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