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

Good #1730

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

Good #1730

wants to merge 3 commits into from

Conversation

Just-Kexit
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Thank you for your hard work on this submission! 😊 While your code meets many of the task requirements, there are a few critical issues that need to be addressed before we can approve it:

  1. Logical Error in sell_product Method: In the CinemaBar class, the sell_product method should use the product parameter directly instead of overwriting it with customer.food. This change is crucial to ensure the correct product is sold.

  2. Type Mismatch in movie_session Method: The CinemaHall class's movie_session method should accept a list of Customer instances, not a single instance. This adjustment is necessary for the method to handle multiple customers properly.

  3. Redundant Loop in cinema_visit Function: The creation of Customer, Cleaner, and CinemaHall instances should occur outside of any loops to avoid unnecessary repetition and inefficiency.

  4. Incorrect Return Type in Cleaner Class: The __init__ and clean_hall methods should not have return type annotations, or should return None respectively, as they do not return any value.

Please address these issues to ensure your code functions as intended and meets the task requirements. Keep up the great work, and don't hesitate to reach out if you need further assistance! 🚀

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review button in the Reviewers tab.

Comment on lines +8 to +9
def sell_product(product: str, customer: Customer) -> None:
product = customer.food

Choose a reason for hiding this comment

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

The sell_product method should use the product parameter directly instead of overwriting it with customer.food. This ensures that the method sells the product specified by the caller, not just the food associated with the customer.

def movie_session(
self,
movie_name: str,
customers: Customer,

Choose a reason for hiding this comment

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

The customers parameter should be a list of Customer instances, not a single Customer instance. Update the type hint to list[Customer] to reflect this.

Comment on lines +13 to +16
for i in range(len(customers)):
customer_instance = [Customer(c["name"], c["food"]) for c in customers]
cleaner_instance = Cleaner(cleaner)
hall = CinemaHall(hall_number)

Choose a reason for hiding this comment

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

There is an unnecessary loop when creating instances of Customer, Cleaner, and CinemaHall. The loop should be removed, and the instances should be created outside of the loop. This will ensure that the instances are created only once, not repeatedly.

movie: str
) -> None:
for i in range(len(customers)):
customer_instance = [Customer(c["name"], c["food"]) for c in customers]

Choose a reason for hiding this comment

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

The customer_instance should be created outside of the loop. The list comprehension is correct, but it should not be inside a loop. Move it outside the loop to create the list of Customer instances once.



class Cleaner:
def __init__(self, name: str) -> Cleaner:

Choose a reason for hiding this comment

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

The __init__ method should not have a return type annotation. Constructors in Python do not return a value, so the -> Cleaner annotation should be removed.

def __init__(self, name: str) -> Cleaner:
self.name = name

def clean_hall(self, hall_number: int) -> Cleaner:

Choose a reason for hiding this comment

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

The clean_hall method should have a return type of None instead of Cleaner. Update the return type annotation to -> None.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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


Thank you for your submission! 🎉 While your code has made some progress, there are a few critical issues that need attention to fully meet the task requirements:

  1. Logical Error in sell_product Method: In the CinemaBar class, ensure that the sell_product method uses the product parameter directly instead of assigning product = customer.food. This will ensure the correct product is sold.

  2. Type Mismatch in movie_session Method: The CinemaHall class's movie_session method should accept a list of Customer instances, not a single instance. Update the parameter to List[Customer] and import List from typing.

  3. Redundant Loop in cinema_visit Function: Move the creation of Customer, Cleaner, and CinemaHall instances outside of any loops to avoid unnecessary repetition and improve efficiency.

  4. Incorrect Return Type in Cleaner Class: The __init__ and clean_hall methods should not have return type annotations or should be -> None, as they do not return any value.

These issues are important for the functionality and efficiency of your code. Please review the comments and address these points to improve your solution. Remember, addressing these issues will help you avoid similar problems in the future and enhance your coding skills. Keep up the good work and continue learning from your experiences! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨


@staticmethod
def sell_product(product: str, customer: Customer) -> None:
product = customer.food

Choose a reason for hiding this comment

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

The line product = customer.food is incorrect. You should use the product parameter directly instead of overwriting it with customer.food. This will ensure the correct product is sold as intended.

def movie_session(
self,
movie_name: str,
customers: Customer,

Choose a reason for hiding this comment

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

The customers parameter should be a list of Customer instances, not a single Customer. Change the type annotation to List[Customer] and ensure you import List from typing.

Comment on lines +13 to +16
for i in range(len(customers)):
customer_instance = [Customer(c["name"], c["food"]) for c in customers]
cleaner_instance = Cleaner(cleaner)
hall = CinemaHall(hall_number)

Choose a reason for hiding this comment

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

The creation of customer_instance, cleaner_instance, and hall should be moved outside of the loop. Currently, these instances are being recreated in each iteration, which is inefficient and unnecessary.



class Cleaner:
def __init__(self, name: str) -> Cleaner:

Choose a reason for hiding this comment

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

The __init__ method should not have a return type annotation or should be -> None, as it does not return any value.

def __init__(self, name: str) -> Cleaner:
self.name = name

def clean_hall(self, hall_number: int) -> Cleaner:

Choose a reason for hiding this comment

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

The clean_hall method should not have a return type annotation or should be -> None, as it does not return any value.

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