-
Notifications
You must be signed in to change notification settings - Fork 110
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
Hang - Lions #92
base: master
Are you sure you want to change the base?
Hang - Lions #92
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.
Great job! You code looks good overall. There were a few functions that don't quite do what they're supposed to and there are a few places where code could be simpler. See comments below. For commits, remember to commit more often and make your commit messages more descriptive. Instead of talking about which wave was completed, maybe something like "Created Item class" or "Added swap_items function".
from swap_meet.item import Item | ||
class Clothing(Item): | ||
def __init__(self, condition = 0, category = "Clothing" ): |
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.
It would be a good idea to remove category from the __init__
function. We don't want the user to be able to set the category. It should always be "Clothing" for the Clothing class. Instead, you can just add "Clothing" as the category when you call super.
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.
Great!
class Electronics: | ||
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.
Great!
@@ -1,2 +1,26 @@ | |||
|
|||
|
|||
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.
Excellent!
from swap_meet.item import Item | ||
from swap_meet.clothing import Clothing | ||
from swap_meet.decor import Decor | ||
from swap_meet.electronics import Electronics |
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.
These imports actually aren't needed! It's good practice once you're done coding to go back and check to see if you accidentally imported things you don't need and remove them.
assert item_a not in items | ||
assert item_b not in items | ||
assert item_c not in items |
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.
Great job! These asserts are actually not needed. Since the items list is empty, you already know these individual items are not in there.
assert result | ||
assert len(tai.inventory) == 3 | ||
assert len(jesse.inventory) == 3 | ||
assert item_f in tai.inventory | ||
assert item_b in tai.inventory | ||
assert item_a in tai.inventory | ||
assert item_c in jesse.inventory | ||
assert item_d in jesse.inventory | ||
assert item_e in jesse.inventory |
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.
Excellent!
assert result | ||
assert len(tai.inventory) == 3 | ||
assert len(jesse.inventory) == 3 | ||
assert item_f in tai.inventory | ||
assert item_b in tai.inventory | ||
assert item_a in tai.inventory | ||
assert item_c in jesse.inventory | ||
assert item_d in jesse.inventory | ||
assert item_e in jesse.inventory |
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.
Excellent!
assert not result | ||
assert len(tai.inventory) == 3 | ||
assert len(jesse.inventory) == 3 | ||
assert item_c in tai.inventory | ||
assert item_b in tai.inventory | ||
assert item_a in tai.inventory | ||
assert item_f in jesse.inventory | ||
assert item_d in jesse.inventory | ||
assert item_e in jesse.inventory |
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.
Excellent!
assert not result | ||
assert len(tai.inventory) == 3 | ||
assert len(jesse.inventory) == 3 | ||
assert item_c in tai.inventory | ||
assert item_b in tai.inventory | ||
assert item_a in tai.inventory | ||
assert item_f in jesse.inventory | ||
assert item_d in jesse.inventory | ||
assert item_e in jesse.inventory |
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.
Excellent!
Learned a lot about OOP through this project