Add types to _deep_get

This commit is contained in:
Paul O'Leary McCann 2023-01-31 12:46:06 +09:00
parent 3fe723c1f9
commit 9d3e3e6be2

View File

@ -3,6 +3,7 @@ import re
from wasabi import msg from wasabi import msg
import typer import typer
from thinc.api import Config from thinc.api import Config
from typing import Any, Dict, Iterable
import spacy import spacy
from spacy.language import Language from spacy.language import Language
@ -22,7 +23,7 @@ LISTENER_ARCHS = [
] ]
def _deep_get(obj, key, default): def _deep_get(obj: Dict[str, Any], key: Iterable[str], default: Any):
"""Given a multi-part key, try to get the key. If at any point this isn't """Given a multi-part key, try to get the key. If at any point this isn't
possible, return the default. possible, return the default.
""" """