From 1bcb1f7908d0b54e3bcbf08c14b5657d8e362e17 Mon Sep 17 00:00:00 2001 From: Basile Dura Date: Thu, 1 Jun 2023 09:42:14 +0200 Subject: [PATCH] fix: InitializableComponent type hints --- spacy/ty.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spacy/ty.py b/spacy/ty.py index 8f2903d78..09be540e8 100644 --- a/spacy/ty.py +++ b/spacy/ty.py @@ -1,5 +1,7 @@ from typing import TYPE_CHECKING from typing import Optional, Any, Iterable, Dict, Callable, Sequence, List + +from spacy.language import Language from .compat import Protocol, runtime_checkable from thinc.api import Optimizer, Model @@ -32,7 +34,7 @@ class InitializableComponent(Protocol): def initialize( self, get_examples: Callable[[], Iterable["Example"]], - nlp: Iterable["Example"], + nlp: Language, **kwargs: Any ): ...