From 3d6ab25f008457f666b69273f0ed45de85147638 Mon Sep 17 00:00:00 2001 From: himanshu <118502619+himaenshuu@users.noreply.github.com> Date: Mon, 25 Aug 2025 01:49:42 +0530 Subject: [PATCH] Improved docstring for clarity, readability, and practical usage guidance --- yfinance/utils.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/yfinance/utils.py b/yfinance/utils.py index 73f696717..bc36702e2 100644 --- a/yfinance/utils.py +++ b/yfinance/utils.py @@ -1021,6 +1021,36 @@ def generate_list_table_from_dict(data: dict, bullets: bool=True, title: str=Non def generate_list_table_from_dict_universal(data: dict, bullets: bool=True, title: str=None, concat_keys=[]) -> str: """ Generate a list-table for the docstring showing permitted keys/values. + + Parameters + ---------- + data : dict + Dictionary containing keys and their possible values. + bullets : bool, optional + If True, formats values as bullet points. Default is True. + title : str, optional + Title for the table. Default is None. + concat_keys : list, optional + Keys for which short lines should be concatenated. Default is []. + + Returns + ------- + str + A formatted string representing the list-table for documentation. + + Example + ------- + >>> data = {'color': ['red', 'blue'], 'size': ['S', 'M', 'L']} + >>> print(generate_list_table_from_dict_universal(data)) + * - color + - + - blue + - red + - size + - + - L + - M + - S """ table = _generate_table_configurations(title) for k in data.keys():