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

Hang - Lions #92

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Hang - Lions #92

wants to merge 8 commits into from

Conversation

hangmtran
Copy link

Learned a lot about OOP through this project

Copy link

@nancy-harris nancy-harris left a 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" ):

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):

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):

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:

Choose a reason for hiding this comment

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

Excellent!

Comment on lines +1 to +4
from swap_meet.item import Item
from swap_meet.clothing import Clothing
from swap_meet.decor import Decor
from swap_meet.electronics import Electronics

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.

Comment on lines +42 to +44
assert item_a not in items
assert item_b not in items
assert item_c not in items

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.

Comment on lines +88 to +96
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

Choose a reason for hiding this comment

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

Excellent!

Comment on lines +131 to +139
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

Choose a reason for hiding this comment

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

Excellent!

Comment on lines +227 to +235
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

Choose a reason for hiding this comment

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

Excellent!

Comment on lines +265 to +273
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

Choose a reason for hiding this comment

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

Excellent!

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