Browse Source

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

main
Why 1 year ago
committed by GitHub
parent
commit
0b26c720b2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      shap_e/util/collections.py

5
shap_e/util/collections.py

@ -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 "/".

Loading…
Cancel
Save