From 06726687106b5be4b78d5b55dce06588fec7b096 Mon Sep 17 00:00:00 2001 From: Artem Burashnikov Date: Fri, 3 Nov 2023 03:15:08 +0300 Subject: [PATCH] style: update docstring --- depinspect/load/read_data.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/depinspect/load/read_data.py b/depinspect/load/read_data.py index c4817cd..fd0c0bf 100644 --- a/depinspect/load/read_data.py +++ b/depinspect/load/read_data.py @@ -6,6 +6,23 @@ def parse_string_to_list( string: str, prefix_to_exclude: str, delimiter: str, result: List[str] ) -> List[str]: + """ + Parse a string, exclude a specified prefix, split it using a delimiter, + and insert the resulting elements into a list. + + Args: + string (str): The input string to be parsed. + prefix_to_exclude (str): The prefix to exclude from each element in the string. + delimiter (str): The delimiter used to split the string into elements. + result (List[str]): The list to which the parsed elements will be inserted. + + Returns: + List[str]: The updated list containing the parsed elements. + + Example: + If string = "Type: A, B, C", prefix_to_exclude = "Type:", delimiter = ",", and + result = [], the function will append ["A", "B", "C"] to result. + """ for entry in map( lambda x: x.strip(), string[len(prefix_to_exclude) :].strip().split(delimiter) ):