Skip to content

Melinda Hayes - Pine #87

Open
mhayes2019 wants to merge 1 commit into
Ada-C16:masterfrom
mhayes2019:master
Open

Melinda Hayes - Pine #87
mhayes2019 wants to merge 1 commit into
Ada-C16:masterfrom
mhayes2019:master

Conversation

@mhayes2019

Copy link
Copy Markdown

No description provided.

@CheezItMan CheezItMan 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.

One note. I suggest you make regular commits every time you get a function working. That makes it easier, in the future, to roll back your application to a previous state if you need to in the future.

Overall very nice work, you hit the main learning goals here. Take a look at my inline comments and let me know where you have questions.

Comment thread swap_meet/clothing.py
class Clothing:
pass
from swap_meet.item import Item
class Clothing(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/decor.py
class Decor:
pass
from swap_meet.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
class Electronics:
pass
from swap_meet.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,21 @@
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/vendor.py

class Vendor:
pass
def __init__(self, inventory=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.

👍

Comment thread swap_meet/vendor.py
Comment on lines +35 to +36
if my_item not in self.inventory or their_item not in vendor.inventory:
return False

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Minor note:
I don't think this if is needed

Suggested change
if my_item not in self.inventory or their_item not in vendor.inventory:
return False
return False

Comment thread swap_meet/vendor.py
if my_item not in self.inventory or their_item not in vendor.inventory:
return False

def swap_first_item(self, another_vendor):

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 reuse of swap_items

Comment thread swap_meet/vendor.py
Comment on lines +39 to +40
if len(self.inventory) and len(another_vendor.inventory) == 0:
return False

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think this really should catch if either vendor has no inventory.

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

Comment thread swap_meet/vendor.py
self.swap_items(another_vendor,my_item,their_item)
return True

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
best_item = item
return best_item

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

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 reuse of existing 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