Fix TypeError for AttrDcit in Python <= 3.8 (#75)

This commit is contained in:
Why
2023-07-12 00:41:38 +08:00
committed by GitHub
parent db3f3b4c2f
commit 0b26c720b2

View File

@@ -1,8 +1,11 @@
from collections import OrderedDict
from typing import Any, Callable, Dict, List, Optional
from typing import OrderedDict, Generic, TypeVar
K = TypeVar('K')
V = TypeVar('V')
class AttrDict(OrderedDict):
class AttrDict(OrderedDict[K, V], Generic[K, V]):
"""
An attribute dictionary that automatically handles nested keys joined by "/".