-
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
Lions- Jessica A. #94
base: master
Are you sure you want to change the base?
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 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! ⭐
|
||
class Clothing(Item): | ||
def __init__(self, condition= 0 ): |
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.
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!
super().__init__(category = category, condition = condition) |
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.
We can shorten L5-6 to one line by saying:
super().__init__(category="Clothing", condition=condition)
|
||
|
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.
🔥 Remove any unnecessary newlines at the end of your files!
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.
Flawless case of inheritance! Great work!
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.
💯 💯 💯
my_item = self.inventory[0] | ||
|
||
self.swap_items(another_vendor, my_item, another_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.
Wonderful use of the helper method!
if item.condition > best_condition_rating: |
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.
We can also combine this into:
if item.category == category and item.condition > best_condition_rating:
|
||
|
||
if my_swap_item is not None and other_vendor_swap_item is not None: |
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.
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
@@ -28,21 +28,27 @@ def test_integration_wave_01_02_03(): | |||
assert item1 not in vendor.inventory | |||
assert remove_result == item1 | |||
|
|||
print(f"This is vendor inventory{vendor.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.
Remember to remove your debugging print statements after you finished using them! 😉
assert len(items) == 0 | ||
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.
Nice! ✨
No description provided.