Skip to content

Solution#2552

Open
dimonalek wants to merge 3 commits intomate-academy:masterfrom
dimonalek:develop
Open

Solution#2552
dimonalek wants to merge 3 commits intomate-academy:masterfrom
dimonalek:develop

Conversation

@dimonalek
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.

Review Summary

I am requesting changes because a core requirement regarding method return types has not been met. Your project's logic is correct, but the task specifies that methods should not return any values. The correct type hint for a function that doesn't return anything is -> None, but your methods are consistently hinted as -> str.

Please correct the return type hints in sell_product, movie_session, watch_movie, and clean_hall across their respective files. This is an important concept for writing clear and accurate code.

Additionally, a good practice to adopt is to avoid modifying input parameters, as seen in app/main.py. Creating a new list of Customer objects would be a better approach than altering the original list. After you fix the type hints, your submission will be ready!


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

Important

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

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

@@ -0,0 +1,4 @@
class CinemaBar:
@staticmethod
def sell_product(product: str, customer: object) -> str:

Choose a reason for hiding this comment

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

The task description states that methods should not return any value. The correct return type hint for a function that doesn't return anything is None, not str.

app/main.py Outdated
) -> None:
customer_list = []
for customer in customers:
customer["instance"] = Customer(customer["name"], customer["food"])

Choose a reason for hiding this comment

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

Modifying input parameters, like this customers list, is considered a bad practice because it creates side effects that can be hard to track. It's better to create a new list of Customer objects without altering the original list of dictionaries.

app/main.py Outdated
Comment on lines +18 to +19
for customer in customers:
CinemaBar.sell_product(customer["instance"].food, customer["instance"])

Choose a reason for hiding this comment

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

Since you have already collected all Customer instances in customer_list, it would be more direct and clear to iterate over customer_list here instead of iterating over the original customers list again.

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

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

Choose a reason for hiding this comment

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

The task requirements state that methods should only print messages and not return anything. The return type hint should be -> None to reflect that this method does not return a value.

movie_name: str,
customers: list,
cleaning_staff: object
) -> str:

Choose a reason for hiding this comment

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

The task description states that methods should only print messages and not return anything. This method correctly returns None implicitly, but the type hint -> str is incorrect. It should be -> None to match the actual behavior.

self.name = name
self.food = food

def watch_movie(self, movie: str) -> str:

Choose a reason for hiding this comment

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

The task requirements state that methods should only print messages and not return anything. The return type hint here should be -> None to reflect that this method does not return a value.

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.

Review Summary

Excellent work on this submission! I am approving it because you've successfully addressed all the feedback from the previous review. The type hints are now correct across all files, and the overall logic perfectly matches the project requirements. Your code is clean, well-structured, and functions as expected. Keep up the great work!


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

Footnotes

  1. Rate AI review example

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