diff --git a/Utils.py b/Utils.py index 7ffce4015ea9..ce076a064a73 100644 --- a/Utils.py +++ b/Utils.py @@ -458,8 +458,11 @@ class KeyedDefaultDict(collections.defaultdict): """defaultdict variant that uses the missing key as argument to default_factory""" default_factory: typing.Callable[[typing.Any], typing.Any] - def __init__(self, default_factory: typing.Callable[[Any], Any] = None, *args, **kwargs): - super().__init__(default_factory, *args, **kwargs) + def __init__(self, + default_factory: typing.Callable[[Any], Any] = None, + default: typing.Union[typing.Mapping, typing.Iterable, None] = None, + **kwargs): + super().__init__(default_factory, default, **kwargs) def __missing__(self, key): self[key] = value = self.default_factory(key)