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

Paper, Al #61

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

Paper, Al #61

wants to merge 8 commits into from

Conversation

Alli-Oops
Copy link

This is my completed swap_meet project.

…nteract with items. Also made notes in test_wave_01.py - passed all test in wave 1.
… method, get_by_category() takes a str -category. loops, grabs matches in inventory with item.category. returns list. Passed Wave 2.
…r objects. added strigify method to item.py that returns Hello World! Passed Wave 3
…d to the Vendor class. Passed all tests in Wave 6
Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

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

Nice work Al, you hit the learning goals here. Well done. I had a few comments, mostly on code style. Well done.

You might consider using DocStrings in your methods, to comment and document them. It might take the place of your inline methods.

Comment on lines +18 to +19
def clothing_condition_description(self, condition):
super().condition_description()

Choose a reason for hiding this comment

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

I don't think these methods are needed.

# the instances/obects of the Item class will be components of the Vendor class' instance - vendor objects "have many" item objects

### test 2.1 PASSED ### setting the default argument makes it optional
class Item:

Choose a reason for hiding this comment

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

👍

self.inventory = []
else:
self.inventory = inventory
# self.get_by_category = get_by_category() -- this is a Vendor method and does not need to be an attribute.

Choose a reason for hiding this comment

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

True


### test 1.1 PASSED ### test 1.2 PASSED ###
class Vendor:
def __init__(self, inventory = None): #get_by_category,

Choose a reason for hiding this comment

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

👍

# self.get_by_category = get_by_category() -- this is a Vendor method and does not need to be an attribute.

### test 1.3 PASSED ###
def add(self, item):

Choose a reason for hiding this comment

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

👍

return remove_item

### test 2.2 PASSED ### test 2.3 PASSED ###
def get_by_category(self, category):

Choose a reason for hiding this comment

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

👍

#^^^returns an empty list if no item-instances belong to the category passed in.

## PASSED ## test 3.2 ## test 3.3 ## test 3.4 ## test 3.5 ## test 3.6 ##
def swap_items(self, friendor, my_item, their_item):

Choose a reason for hiding this comment

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

👍 , but you don't need the else: See my example further below.

Comment on lines +66 to +72
else:
print("something else")
friendor.inventory.append(self.inventory[0])
self.inventory.remove(self.inventory[0])
self.inventory.append(friendor.inventory[0])
friendor.inventory.remove(friendor.inventory[0])
return True

Choose a reason for hiding this comment

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

You don't need the else: here.

Suggested change
else:
print("something else")
friendor.inventory.append(self.inventory[0])
self.inventory.remove(self.inventory[0])
self.inventory.append(friendor.inventory[0])
friendor.inventory.remove(friendor.inventory[0])
return True
friendor.inventory.append(self.inventory[0])
self.inventory.remove(self.inventory[0])
self.inventory.append(friendor.inventory[0])
friendor.inventory.remove(friendor.inventory[0])
return True

Also friendor??

return True

### test 6.1 PASSED ### test 6.2 PASSED ### test 6.3 PASSED ###
def get_best_by_category(self, category):

Choose a reason for hiding this comment

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

Nice use of a lambda (sort of) function!



### test 6.4 PASSED ### test 6.5 PASSED ### test 6.6 PASSED ###
def swap_best_by_category(self, other, my_priority, their_priority):

Choose a reason for hiding this comment

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

👍 Good reuse of methods!

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