From 757e331fa6c4d3c0f84929b8c4d7fdfd558f627c Mon Sep 17 00:00:00 2001 From: Zach Parks Date: Sat, 1 Jun 2024 21:48:46 -0500 Subject: [PATCH] Technically more accurate. --- Utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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)