From fb89eb898eb433e0c06d6962f2cad09d7fa3cdc9 Mon Sep 17 00:00:00 2001 From: thomashacker Date: Fri, 3 Feb 2023 18:32:55 +0100 Subject: [PATCH] Fix registry find return type --- spacy/util.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/spacy/util.py b/spacy/util.py index 8bf8fb1b0..89e8eac9a 100644 --- a/spacy/util.py +++ b/spacy/util.py @@ -144,8 +144,17 @@ class registry(thinc.registry): return func @classmethod - def find(cls, registry_name: str, func_name: str) -> Callable: - """Get info about a registered function from the registry.""" + def find( + cls, registry_name: str, func_name: str + ) -> Dict[str, Optional[Union[str, int]]]: + """Find the information about a registered function, including the + module and path to the file it's defined in, the line number and the + docstring, if available. + + registry_name (str): Name of the catalogue registry + func_name (str): Name of the registered function. + RETURNS (Dict[str, Optional[Union[str, int]]]): The function info. + """ # We're overwriting this classmethod so we're able to provide more # specific error messages and implement a fallback to spacy-legacy. if not hasattr(cls, registry_name):