From: Scott Gasch Date: Tue, 13 Jun 2023 04:26:39 +0000 (-0700) Subject: More docstring updates. X-Git-Url: https://wannabe.guru.org/gitweb/?a=commitdiff_plain;h=c93ed6d32dbe98f6950dc06779a936d90ff7a058;p=pyutils.git More docstring updates. --- diff --git a/src/pyutils/argparse_utils.py b/src/pyutils/argparse_utils.py index 6920bfa..aa48899 100644 --- a/src/pyutils/argparse_utils.py +++ b/src/pyutils/argparse_utils.py @@ -203,7 +203,7 @@ def valid_mac(mac: str) -> str: mac: a value passed to a commandline flag expecting a MAC address. Returns: - The MAC address passed or raises ArgumentTypeError on error. + The MAC address passed Raises: ArgumentTypeError: parse error (e.g. not a valid MAC address) @@ -339,7 +339,7 @@ def valid_date(txt: str) -> datetime.date: txt: data passed to a commandline flag expecting a date. Returns: - the datetime.date described by txt or raises ArgumentTypeError on error. + the datetime.date described by txt Raises: ArgumentTypeError: parse error (e.g. date not valid) @@ -384,7 +384,7 @@ def valid_datetime(txt: str) -> datetime.datetime: txt: data passed to a commandline flag expecting a valid datetime.datetime. Returns: - The datetime.datetime described by txt or raises ArgumentTypeError on error. + The datetime.datetime described by txt Raises: ArgumentTypeError: parse error (e.g. invalid datetime string) @@ -452,7 +452,7 @@ def valid_duration(txt: str) -> datetime.timedelta: txt: data passed to a commandline arg expecting a duration. Returns: - The datetime.timedelta described by txt or raises ArgumentTypeError + The datetime.timedelta described by txt on error. Raises: @@ -508,8 +508,7 @@ def valid_byte_count(txt: str) -> int: txt: data passed to a commandline arg expecting a duration. Returns: - An integer number of bytes or raises ArgumentTypeError on - error. + An integer number of bytes. Raises: ArgumentTypeError: parse error (e.g. byte count not parsable) diff --git a/src/pyutils/string_utils.py b/src/pyutils/string_utils.py index 7e2b999..a016d07 100644 --- a/src/pyutils/string_utils.py +++ b/src/pyutils/string_utils.py @@ -522,7 +522,7 @@ def to_int(in_str: str) -> int: in_str: the string to convert Returns: - The integral value of the string or raises on error. + The integral value of the string. Raises: TypeError: the input argument isn't a string