Utils: Fix mistake made with `KeyedDefaultDict` from #1933 that broke tracker functionality. (#3433)
This commit is contained in:
parent
70e9ccb13c
commit
cff7327558
8
Utils.py
8
Utils.py
|
@ -458,7 +458,13 @@ class KeyedDefaultDict(collections.defaultdict):
|
||||||
"""defaultdict variant that uses the missing key as argument to default_factory"""
|
"""defaultdict variant that uses the missing key as argument to default_factory"""
|
||||||
default_factory: typing.Callable[[typing.Any], typing.Any]
|
default_factory: typing.Callable[[typing.Any], typing.Any]
|
||||||
|
|
||||||
def __init__(self, default_factory: typing.Callable[[Any], Any] = None, **kwargs):
|
def __init__(self,
|
||||||
|
default_factory: typing.Callable[[Any], Any] = None,
|
||||||
|
seq: typing.Union[typing.Mapping, typing.Iterable, None] = None,
|
||||||
|
**kwargs):
|
||||||
|
if seq is not None:
|
||||||
|
super().__init__(default_factory, seq, **kwargs)
|
||||||
|
else:
|
||||||
super().__init__(default_factory, **kwargs)
|
super().__init__(default_factory, **kwargs)
|
||||||
|
|
||||||
def __missing__(self, key):
|
def __missing__(self, key):
|
||||||
|
|
Loading…
Reference in New Issue