Skip to content

Commit

Permalink
ValT -> TaggedValT
Browse files Browse the repository at this point in the history
  • Loading branch information
elcarpenterNOAA committed Jan 7, 2025
1 parent 986226f commit 0663c47
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/uwtools/config/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class UWYAMLConvert(UWYAMLTag):
"""

TAGS = ("!bool", "!datetime", "!dict", "!float", "!int", "!list")
ValT = Union[bool, datetime, dict, float, int, list]
TaggedValT = Union[bool, datetime, dict, float, int, list]

def __init__(self, loader: yaml.SafeLoader, node: yaml.nodes.ScalarNode) -> None:
super().__init__(loader, node)
Expand All @@ -144,14 +144,14 @@ def __str__(self) -> str:
return str(self.converted)

@property
def converted(self) -> UWYAMLConvert.ValT:
def converted(self) -> UWYAMLConvert.TaggedValT:
"""
Return the original YAML value converted to the type speficied by the tag.
:raises: Appropriate exception if the value cannot be represented as the required type.
"""
load_as = lambda t, v: t(yaml.safe_load(v))
converters: list[Callable[..., UWYAMLConvert.ValT]] = [
converters: list[Callable[..., UWYAMLConvert.TaggedValT]] = [
partial(load_as, bool),
datetime.fromisoformat,
partial(load_as, dict),
Expand Down

0 comments on commit 0663c47

Please sign in to comment.