-
Notifications
You must be signed in to change notification settings - Fork 94
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
Pine - Victoria Duke #79
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the small regular commits you made with git as you went through the project. Very meaningful commit messages as well.
Nice work Victoria, you hit the learning goals here. All the functions are readable and work well. Well done.
pass | ||
from swap_meet.item import Item | ||
|
||
class Clothing(Item): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
pass | ||
from swap_meet.item import Item | ||
|
||
class Decor(Item): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
pass | ||
from swap_meet.item import Item | ||
|
||
class Electronics(Item): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -1,2 +1,24 @@ | |||
class Item: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
class Vendor: | ||
pass | ||
def __init__(self, inventory=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
self.inventory.remove(item) | ||
return item | ||
|
||
def get_by_category(self, category=""): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
items.append(item) | ||
return items | ||
|
||
def swap_items(self, their_vendor, my_item, their_item): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
their_vendor.add(my_item) | ||
return True | ||
|
||
def swap_first_item(self, their_vendor): |
There was a problem hiding this comment.
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
their_first_item = their_vendor.inventory[0] | ||
return self.swap_items(their_vendor, my_first_item, their_first_item) | ||
|
||
def get_best_by_category(self, category): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Why not use get_by_category
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I meant to! I think I got distracted by a different part and didn't come back to this.
best_item = item | ||
return best_item | ||
|
||
def swap_best_by_category(self, other, my_priority, their_priority): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Good reuse of get_best_by_category
and swap_items
No description provided.