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

Panthers - Cintia/Ryan #90

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

Conversation

cintiashamsu
Copy link

No description provided.

Copy link

@ameerrah9 ameerrah9 left a comment

Choose a reason for hiding this comment

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

Congratulations on completing this project Cintia and Ryan! There's some impressive code in here, and it's very clean and easy to read. Great use of helper methods in the Vendor class! Excellent work using inheritance to create the children classes!

Comment on lines +1 to +4
# creates class/category Clothing using class Item
# stringifies Clothing
class Clothing(Item):

Choose a reason for hiding this comment

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

Amazing work completing your project yall! This inheritance is sweet and the comment clearly explains what your method's objective is 💯

Choose a reason for hiding this comment

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

Excellent work with these default arguments

Comment on lines +1 to +4
# creates class/category Decor using class Item
# stringifies Decor
class Decor(Item):

Choose a reason for hiding this comment

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

👍🏾

Comment on lines +1 to +7
from swap_meet.item import Item
# creates class/category Electronics using class Item
# stringifies Electronics
class Electronics(Item):
def __init__(self, category="Electronics", condition=0):
self.category = category
self.condition = condition

Choose a reason for hiding this comment

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

Comment on lines +3 to +5
category = ""
self.category = category

Choose a reason for hiding this comment

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

Good job using this default parameter of None. None is often used as a default argument value in Python because it allows us to call the function without providing a value for an argument that isn't required on each function invocation. Here's the article I referenced: https://bobbyhadz.com/blog/python-using-none-as-default-argument#:~:text=None%20is%20often%20used%20as,for%20list%20and%20dict%20arguments.
You could refactor this to a shorthand (one-liner): self.category = category if category is not None else ""

Comment on lines +11 to +23
if self.condition == 0:
return "Horrible Condition >:("
elif self.condition == 1:
return "Heavily Used :("
elif self.condition == 2:
return "So-So condition :/"
elif self.condition == 3:
return "Decent :|"
elif self.condition == 4:
return "Gently Used :)"
elif self.condition == 5:
return "Like New! >:)"

Choose a reason for hiding this comment

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

Nice way to implement your description! It uses conditional flow pretty well

Comment on lines +20 to +27
if not category:
return None
matching_items = []
for item in self.inventory:
if item.category == category:
matching_items.append(item)
return matching_items

Choose a reason for hiding this comment

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

Nice job!

Comment on lines +30 to +37
if my_item in self.inventory and their_item in friend.inventory:
self.add(their_item)
friend.add(my_item)
self.remove(my_item)
friend.remove(their_item)
return True
return False

Choose a reason for hiding this comment

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

This looks good to me!

Comment on lines +49 to +59
inventory = self.get_by_category(category)
if not inventory:
return None
highest = 0
best_item = None
for item in inventory:
if item.condition > highest:
highest = item.condition
best_item = item
return best_item

Choose a reason for hiding this comment

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

Nice job connecting what you learned from the Problem Solving Exercise 👍🏾

Comment on lines +48 to +53
assert result == False

assert len(vendor.inventory) == 3
assert "a" in vendor.inventory
assert "b" in vendor.inventory
assert "c" in vendor.inventory

Choose a reason for hiding this comment

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

You can check the result more pythonically but checking for the falseyness!

Comment on lines +73 to +82
assert result
assert len(tai.inventory) == 3
assert len(jesse.inventory) == 3

assert item_a in tai.inventory
assert item_b in tai.inventory
assert item_f 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.

👍🏾

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.

3 participants