Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

add a checked parameter type in _maybe_load_yaml() #293

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions seq2seq/configurable.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ def _maybe_load_yaml(item):
"""
if isinstance(item, six.string_types):
return yaml.load(item)
elif isinstance(item, dict):
elif isinstance(item, dict) or isinstance(item, list):
return item
else:
raise ValueError("Got {}, expected YAML string or dict", type(item))
raise ValueError("Got {}, expected YAML string or dict or list of dicts", type(item))


def _deep_merge_dict(dict_x, dict_y, path=None):
Expand Down