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

Miranda - Lion #83

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

Miranda - Lion #83

wants to merge 8 commits into from

Conversation

yxzhang88
Copy link

No description provided.

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.

Excellent job! Your code overall is great! There are some comments about places where the code could be DRY-ed up. For commits, it would be a good idea to commit more often! It would also be great if the commit messages could focus on what changes were made to the code. Instead of messages about being stuck, it would be good to have something like "Created Item class" or "Added swap_item function".


class Clothing(Item):
def __init__(self, category = "Clothing", condition = 0):

Choose a reason for hiding this comment

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

Great job! We actually don't want to have category in the __init__ function. Since Clothing objects should always have "Clothing" as the category we do not want to let the user to put in their own information. On line 5 instead of category you can put "Clothing" to pass to the super class.

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 job!

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 job!

def __init__(self, category = None, condition = 0):

Choose a reason for hiding this comment

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

The default for category can be "" instead of None. We use None for mutable data types like lists or dictionaries. Since string are immutable in Python, we do not need None.

return "Hello World!"

def condition_description(self):

Choose a reason for hiding this comment

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

It looks like you were changing some of the conditions in the if statements, but didn't finish. The logic has some gaps in it. Good start though!

Comment on lines +39 to +41
assert item_a not in items
assert item_c not in items
assert item_b not in items

Choose a reason for hiding this comment

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

Great asserts! These three aren't necessary since the first one tells us there's nothing in the list. We don't need to check each individual item.

Comment on lines +80 to +90
assert result is True
assert len(tai.inventory) == 3
assert len(jesse.inventory) == 3
assert item_a in tai.inventory
assert item_b in tai.inventory
assert item_c not in tai.inventory
assert item_f in tai.inventory
assert item_d in jesse.inventory
assert item_e in jesse.inventory
assert item_f not in jesse.inventory
assert item_c 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 +128 to +138
assert result is True
assert len(tai.inventory) == 3
assert len(jesse.inventory) == 3
assert item_a in tai.inventory
assert item_b in tai.inventory
assert item_c not in tai.inventory
assert item_f in tai.inventory
assert item_d in jesse.inventory
assert item_e in jesse.inventory
assert item_f not in jesse.inventory
assert item_c 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 +224 to +233
assert result is False
assert len(tai.inventory) == 3
assert len(jesse.inventory) == 3
assert item_a in tai.inventory
assert item_b in tai.inventory
assert item_c in tai.inventory

assert item_d in jesse.inventory
assert item_e in jesse.inventory
assert item_f 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 +268 to +277
assert result is False
assert len(tai.inventory) == 3
assert len(jesse.inventory) == 3
assert item_a in tai.inventory
assert item_b in tai.inventory
assert item_c in tai.inventory

assert item_d in jesse.inventory
assert item_e in jesse.inventory
assert item_f 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