Skip to content

Commit 7532dee

Browse files
committed
fix: Ensure that dict_type has a default for OrderedDefaultDict to work with deepcopy.
1 parent 36f35fc commit 7532dee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

diffsync/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"""
1717

1818
from collections import OrderedDict
19-
from typing import Iterator, List, Dict, Optional, TypeVar, Callable, Generic
19+
from typing import Callable, Dict, Generic, Iterator, List, Optional, TypeVar
2020

2121
SPACE = " "
2222
BRANCH = "│ "
@@ -44,7 +44,7 @@ def symmetric_difference(lst1: List[T], lst2: List[T]) -> List[T]:
4444
class OrderedDefaultDict(OrderedDict, Generic[K, V]):
4545
"""A combination of collections.OrderedDict and collections.DefaultDict behavior."""
4646

47-
def __init__(self, dict_type: Callable[[], V]) -> None:
47+
def __init__(self, dict_type: Callable[[], V] = dict) -> None:
4848
"""Create a new OrderedDefaultDict."""
4949
self.factory = dict_type
5050
super().__init__(self)

0 commit comments

Comments
 (0)