Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jsonargparse/_optionals.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def omegaconf_load(value):
if isinstance(value_pyyaml, (str, int, float, bool)) or value_pyyaml is None:
return value_pyyaml
value_omegaconf = OmegaConf.to_object(OmegaConf.load(io.StringIO(value)))
str_ref = {k: None for k in [value]}
str_ref = dict.fromkeys([value], None)
return value_pyyaml if value_omegaconf == str_ref else value_omegaconf

return omegaconf_load
Expand Down
2 changes: 1 addition & 1 deletion jsonargparse/_type_checking.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

from ._core import ActionsContainer, ArgumentGroup, ArgumentParser
else:
globals().update({k: None for k in __all__})
globals().update(dict.fromkeys(__all__, None))
3 changes: 1 addition & 2 deletions jsonargparse/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import pathlib
import re
import sys
from re import Pattern
from typing import Any, Callable, Optional, Union

if sys.version_info >= (3, 10):
Expand Down Expand Up @@ -181,7 +180,7 @@ def validation_fn(cls, v):

def restricted_string_type(
name: str,
regex: Union[str, Pattern],
regex: Union[str, re.Pattern],
docstring: Optional[str] = None,
) -> _TypeAlias:
"""Creates or returns an already registered restricted string type class.
Expand Down