Skip to content

Lions- Jessica A.#94

Open
Jessicaenvisions wants to merge 9 commits intoAda-C18:masterfrom
Jessicaenvisions:master
Open

Lions- Jessica A.#94
Jessicaenvisions wants to merge 9 commits intoAda-C18:masterfrom
Jessicaenvisions:master

Conversation

@Jessicaenvisions
Copy link

No description provided.

Copy link

@goeunpark goeunpark left a comment

Choose a reason for hiding this comment

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

Great work, Jessica! 🎉

I'm so proud of how far you've come! Your tests pass, your classes look solid, your commit messages are frequent, and you are passing data through functions like a pro. This project is a well-deserved Green. 🟢

One small thing I wanted to point your attention towards was around consistent spacing. Generally, there should be just one newline at the end of a function and at the end of the file. Inside a function, I try to not create an empty line unless it really does help with organizing chunks of my code. For example, looking at your vendor.py, the code in get_best_by_category() feels really tight and concise while swap_items() just above is has good code, but the spacing makes it feel longer that necessary. This is also a skill that you develop over time; let me know if you'd like me to elaborate on this matter!

Overall, great work! Keep it up! ⭐

from swap_meet.item import Item

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

Choose a reason for hiding this comment

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

Make sure to clean up your code before submission with proper spaces (or in this case, no spaces) between the values before and after the =. Clean code goes a long way and I found this section in the PEP8 style convention really useful!

Comment on lines +5 to +6
category = "Clothing"
super().__init__(category = category, condition = condition)

Choose a reason for hiding this comment

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

We can shorten L5-6 to one line by saying:

super().__init__(category="Clothing", condition=condition)

Comment on lines +10 to +12



Choose a reason for hiding this comment

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

🔥 Remove any unnecessary newlines at the end of your files!

pass No newline at end of file
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.

Flawless case of inheritance! Great work!

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.

💯 💯 💯

another_item = another_vendor.inventory[0]
my_item = self.inventory[0]

self.swap_items(another_vendor, my_item, another_item)

Choose a reason for hiding this comment

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

Wonderful use of the helper method!

Comment on lines +59 to +60
if item.category == category:
if item.condition > best_condition_rating:

Choose a reason for hiding this comment

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

We can also combine this into:

if item.category == category and item.condition > best_condition_rating:

other_vendor_swap_item = other.get_best_by_category(my_priority)


if my_swap_item is not None and other_vendor_swap_item is not None:

Choose a reason for hiding this comment

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

We can also shorten this to the following because the values themselves will evaluate to Truthy:

if my_swap_item and other_vendor_swap_item

assert item1 not in vendor.inventory
assert remove_result == item1

print(f"This is vendor inventory{vendor.inventory}")

Choose a reason for hiding this comment

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

Remember to remove your debugging print statements after you finished using them! 😉

Comment on lines +39 to +42
assert len(items) == 0
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.

Nice! ✨

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