From c997bc743d98479804cd83aacd55727643cb6ced Mon Sep 17 00:00:00 2001 From: BethanyG Date: Mon, 11 May 2026 11:00:22 -0700 Subject: [PATCH 1/2] Updated docstrings in stub to use Google style. --- .../mecha-munch-management/dict_methods.py | 50 +++++++++++++------ 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/exercises/concept/mecha-munch-management/dict_methods.py b/exercises/concept/mecha-munch-management/dict_methods.py index 92bfd7325f9..f6804281d21 100644 --- a/exercises/concept/mecha-munch-management/dict_methods.py +++ b/exercises/concept/mecha-munch-management/dict_methods.py @@ -4,9 +4,12 @@ def add_item(current_cart, items_to_add): """Add items to shopping cart. - :param current_cart: dict - the current shopping cart. - :param items_to_add: iterable - items to add to the cart. - :return: dict - the updated user cart dictionary. + Parameters: + current_cart (dict): The current shopping cart. + items_to_add (iterable): The items to add to the cart. + + Returns: + dict: The updated user cart dictionary. """ pass @@ -15,8 +18,11 @@ def add_item(current_cart, items_to_add): def read_notes(notes): """Create user cart from an iterable notes entry. - :param notes: iterable of items to add to cart. - :return: dict - a user shopping cart dictionary. + Parameters: + notes (iterable): Group of items to add to cart. + + Returns: + dict: A user shopping cart dictionary. """ pass @@ -25,9 +31,12 @@ def read_notes(notes): def update_recipes(ideas, recipe_updates): """Update the recipe ideas dictionary. - :param ideas: dict - The "recipe ideas" dict. - :param recipe_updates: iterable - with updates for the ideas section. - :return: dict - updated "recipe ideas" dict. + Parameters: + ideas (dict): The "recipe ideas" dict. + recipe_updates (iterable): Updates for the ideas section. + + Returns: + dict: The updated "recipe ideas" dict. """ pass @@ -36,8 +45,11 @@ def update_recipes(ideas, recipe_updates): def sort_entries(cart): """Sort a users shopping cart in alphabetically order. - :param cart: dict - a users shopping cart dictionary. - :return: dict - users shopping cart sorted in alphabetical order. + Parameters: + cart (dict): A users shopping cart dictionary. + + Returns: + dict: A sers shopping cart sorted in alphabetical order. """ pass @@ -46,9 +58,12 @@ def sort_entries(cart): def send_to_store(cart, aisle_mapping): """Combine users order to aisle and refrigeration information. - :param cart: dict - users shopping cart dictionary. - :param aisle_mapping: dict - aisle and refrigeration information dictionary. - :return: dict - fulfillment dictionary ready to send to store. + Parameters: + cart (dict): The users shopping cart dictionary. + aisle_mapping (dict): The aisle and refrigeration information dictionary. + + Returns: + dict: The fulfillment dictionary ready to send to store. """ pass @@ -57,9 +72,12 @@ def send_to_store(cart, aisle_mapping): def update_store_inventory(fulfillment_cart, store_inventory): """Update store inventory levels with user order. - :param fulfillment cart: dict - fulfillment cart to send to store. - :param store_inventory: dict - store available inventory - :return: dict - store_inventory updated. + Parameters: + fulfillment cart (dict): The fulfillment cart to send to store. + store_inventory (dict): The stores available inventory. + + Returns: + dict: The store_inventory updated. """ pass From 6d68828a6f86df7f790816b0ab589b28c4af01f0 Mon Sep 17 00:00:00 2001 From: BethanyG Date: Mon, 11 May 2026 12:08:06 -0700 Subject: [PATCH 2/2] Updated docstrings in exemplar to use Google style. --- .../mecha-munch-management/.meta/exemplar.py | 53 +++++++++++++------ 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/exercises/concept/mecha-munch-management/.meta/exemplar.py b/exercises/concept/mecha-munch-management/.meta/exemplar.py index ea25110a3be..221a4c259e1 100644 --- a/exercises/concept/mecha-munch-management/.meta/exemplar.py +++ b/exercises/concept/mecha-munch-management/.meta/exemplar.py @@ -4,9 +4,12 @@ def add_item(current_cart, items_to_add): """Add items to shopping cart. - :param current_cart: dict - the current shopping cart. - :param items_to_add: iterable - items to add to the cart. - :return: dict - the updated user cart dictionary. + Parameters: + current_cart (dict): The current shopping cart. + items_to_add (iterable): The items to add to the cart. + + Returns: + dict: The updated user cart dictionary. """ for item in items_to_add: @@ -19,8 +22,11 @@ def add_item(current_cart, items_to_add): def read_notes(notes): """Create user cart from an iterable notes entry. - :param notes: iterable of items to add to cart. - :return: dict - a user shopping cart dictionary. + Parameters: + notes (iterable): Group of items to add to cart. + + Returns: + dict: A user shopping cart dictionary. """ return dict.fromkeys(notes, 1) @@ -29,9 +35,12 @@ def read_notes(notes): def update_recipes(ideas, recipe_updates): """Update the recipe ideas dictionary. - :param ideas: dict - The "recipe ideas" dict. - :param recipe_updates: dict - dictionary with updates for the ideas section. - :return: dict - updated "recipe ideas" dict. + Parameters: + ideas (dict): The "recipe ideas" dict. + recipe_updates (iterable): Updates for the ideas section. + + Returns: + dict: The updated "recipe ideas" dict. """ ideas.update(recipe_updates) @@ -41,9 +50,12 @@ def update_recipes(ideas, recipe_updates): def sort_entries(cart): """Sort a users shopping cart in alphabetically order. - :param cart: dict - a users shopping cart dictionary. - :return: dict - users shopping cart sorted in alphabetical order. - """ + Parameters: + cart (dict): A users shopping cart dictionary. + + Returns: + dict: A sers shopping cart sorted in alphabetical order. + """ return dict(sorted(cart.items())) @@ -51,10 +63,14 @@ def sort_entries(cart): def send_to_store(cart, aisle_mapping): """Combine users order to aisle and refrigeration information. - :param cart: dict - users shopping cart dictionary. - :param aisle_mapping: dict - aisle and refrigeration information dictionary. - :return: dict - fulfillment dictionary ready to send to store. + Parameters: + cart (dict): The users shopping cart dictionary. + aisle_mapping (dict): The aisle and refrigeration information dictionary. + + Returns: + dict: The fulfillment dictionary ready to send to store. """ + fulfillment_cart = {} for key in cart.keys(): @@ -66,9 +82,12 @@ def send_to_store(cart, aisle_mapping): def update_store_inventory(fulfillment_cart, store_inventory): """Update store inventory levels with user order. - :param fulfillment cart: dict - fulfillment cart to send to store. - :param store_inventory: dict - store available inventory - :return: dict - store_inventory updated. + Parameters: + fulfillment cart (dict): The fulfillment cart to send to store. + store_inventory (dict): The stores available inventory. + + Returns: + dict: The store_inventory updated. """ for key, values in fulfillment_cart.items():