Skip to content

Commit

Permalink
Attempt to make mypy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterzwerink authored Jan 17, 2024
1 parent fc33a80 commit a9490a8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions omegaconf/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit a9490a8

Please sign in to comment.