Melinda Hayes - Pine #87
Open
mhayes2019 wants to merge 1 commit into
Open
Conversation
CheezItMan
reviewed
Oct 2, 2021
CheezItMan
left a comment
There was a problem hiding this comment.
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.
| class Clothing: | ||
| pass | ||
| from swap_meet.item import Item | ||
| class Clothing(Item): |
| class Decor: | ||
| pass | ||
| from swap_meet.item import Item | ||
| class Decor(Item): |
| class Electronics: | ||
| pass | ||
| from swap_meet.item import Item | ||
| class Electronics(Item): |
| @@ -1,2 +1,21 @@ | |||
| class Item: | |||
|
|
||
| class Vendor: | ||
| pass | ||
| def __init__(self, inventory=None): |
Comment on lines
+35
to
+36
| if my_item not in self.inventory or their_item not in vendor.inventory: | ||
| return False |
There was a problem hiding this comment.
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 |
| if my_item not in self.inventory or their_item not in vendor.inventory: | ||
| return False | ||
|
|
||
| def swap_first_item(self, another_vendor): |
Comment on lines
+39
to
+40
| if len(self.inventory) and len(another_vendor.inventory) == 0: | ||
| return False |
There was a problem hiding this comment.
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 |
| self.swap_items(another_vendor,my_item,their_item) | ||
| return True | ||
|
|
||
| def get_best_by_category(self,category): |
| best_item = item | ||
| return best_item | ||
|
|
||
| def swap_best_by_category(self,other,my_priority,their_priority): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.