Skip to content
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
9 changes: 5 additions & 4 deletions simple_parsing/helpers/subgroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import functools
import inspect
import typing
from collections.abc import Mapping
from dataclasses import _MISSING_TYPE, MISSING
from enum import Enum
from logging import getLogger as get_logger
Expand All @@ -21,7 +22,7 @@

@overload
def subgroups(
subgroups: dict[Key, DataclassT | type[DataclassT] | functools.partial[DataclassT]],
subgroups: Mapping[Key, DataclassT | type[DataclassT] | functools.partial[DataclassT]],
*args,
default: Key | DataclassT,
default_factory: _MISSING_TYPE = MISSING,
Expand All @@ -32,7 +33,7 @@ def subgroups(

@overload
def subgroups(
subgroups: dict[Key, DataclassT | type[DataclassT] | functools.partial[DataclassT]],
subgroups: Mapping[Key, DataclassT | type[DataclassT] | functools.partial[DataclassT]],
*args,
default: _MISSING_TYPE = MISSING,
default_factory: type[DataclassT] | functools.partial[DataclassT],
Expand All @@ -43,7 +44,7 @@ def subgroups(

@overload
def subgroups(
subgroups: dict[Key, DataclassT | type[DataclassT] | functools.partial[DataclassT]],
subgroups: Mapping[Key, DataclassT | type[DataclassT] | functools.partial[DataclassT]],
*args,
default: _MISSING_TYPE = MISSING,
default_factory: _MISSING_TYPE = MISSING,
Expand All @@ -53,7 +54,7 @@ def subgroups(


def subgroups(
subgroups: dict[Key, DataclassT | type[DataclassT] | functools.partial[DataclassT]],
subgroups: Mapping[Key, DataclassT | type[DataclassT] | functools.partial[DataclassT]],
*args,
default: Key | DataclassT | _MISSING_TYPE = MISSING,
default_factory: type[DataclassT] | functools.partial[DataclassT] | _MISSING_TYPE = MISSING,
Expand Down