From a9490a84e23ae2bf1647212b9a957e12bfb43a39 Mon Sep 17 00:00:00 2001 From: Wouter Zwerink <35296208+wouterzwerink@users.noreply.github.com> Date: Wed, 17 Jan 2024 15:29:23 +0100 Subject: [PATCH] Attempt to make mypy happy --- omegaconf/_utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/omegaconf/_utils.py b/omegaconf/_utils.py index d3ba58de8..ef34e951a 100644 --- a/omegaconf/_utils.py +++ b/omegaconf/_utils.py @@ -45,8 +45,10 @@ from yaml import CDumper BaseDumper = CDumper + BaseDumperType: Type[CDumper] = type(CDumper) except ImportError: # pragma: no cover BaseDumper = yaml.Dumper + BaseDumperType: Type[yaml.Dumper] = type(yaml.Dumper) NoneType: Type[None] = type(None) @@ -112,11 +114,11 @@ def __repr__(self) -> str: _DEFAULT_MARKER_: Any = Marker("_DEFAULT_MARKER_") -class OmegaConfDumper(BaseDumper): # type: ignore +class OmegaConfDumper(BaseDumperType): # type: ignore str_representer_added = False @staticmethod - def str_representer(dumper: BaseDumper, data: str) -> yaml.ScalarNode: + def str_representer(dumper: BaseDumperType, data: str) -> yaml.ScalarNode: with_quotes = yaml_is_bool(data) or is_int(data) or is_float(data) return dumper.represent_scalar( yaml.resolver.BaseResolver.DEFAULT_SCALAR_TAG,