Skip to content

Commit 22a97df

Browse files
committed
Add typing.Dict to assert dict type
1 parent 234f2fd commit 22a97df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

coqpit/coqpit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def is_dict(arg_type: Any) -> bool:
6262
bool: True if input type is `dict`
6363
"""
6464
try:
65-
return arg_type is dict or arg_type.__origin__ is dict
65+
return arg_type is dict or arg_type is Dict or arg_type.__origin__ is dict
6666
except AttributeError:
6767
return False
6868

@@ -740,7 +740,7 @@ def init_from_argparse(
740740
if isinstance(args, list):
741741
# If a list was passed in (eg. the second result of `parse_known_args`, run that through argparse first to get a parsed Namespace
742742
parser = cls.init_argparse(cls, arg_prefix=arg_prefix)
743-
args = parser.parse_args(args) # pylint: disable=E1120, E1111
743+
args = parser.parse_args(args) # pylint: disable=E1120, E1111
744744

745745
# Handle list and object attributes with defaults, which can be modified
746746
# directly (eg. --coqpit.list.0.val_a 1), by constructing real objects

0 commit comments

Comments
 (0)