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--Andrea Palacios #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

dre-create
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.

Nice work Andrea, you hit all the learning goals here. Well done. I had a few minor comments, mostly on programming style. Let me know if you have questions.

@@ -0,0 +1,10 @@
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 classes!

@@ -0,0 +1,22 @@

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.

👍

self.inventory = inventory


def add(self, item):

Choose a reason for hiding this comment

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

👍

return item


def remove(self, item):

Choose a reason for hiding this comment

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

👍

Comment on lines +40 to +41
else:
return False

Choose a reason for hiding this comment

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

Suggested change
else:
return False
return False

return False


def swap_first_item(self, other):

Choose a reason for hiding this comment

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

👍 , just note that you don't need the else:



def swap_first_item(self, other):
if len(self.inventory) == 0 or len(other.inventory) == 0:

Choose a reason for hiding this comment

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

You can simplify this a bit.

Suggested change
if len(self.inventory) == 0 or len(other.inventory) == 0:
if not self.inventory or not other.inventory:

return True


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.

👍

#[for item in items_list if item.condition > best_condition_item.condition]


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