From 90eba72344f1b1994e496f37947d312c88486e50 Mon Sep 17 00:00:00 2001 From: Michael Ekstrand Date: Tue, 14 Jan 2025 09:49:20 -0500 Subject: [PATCH] refine any/none config class logic --- lenskit/lenskit/pipeline/components.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lenskit/lenskit/pipeline/components.py b/lenskit/lenskit/pipeline/components.py index 46cf08ee6..de7954703 100644 --- a/lenskit/lenskit/pipeline/components.py +++ b/lenskit/lenskit/pipeline/components.py @@ -169,9 +169,9 @@ def __init__(self, config: object | None = None, **kwargs: Any): def _config_class(cls, return_any: bool = False) -> type | None: hints = get_type_hints(cls) ct = hints.get("config", None) - if ct is None or ct == NoneType: + if ct == NoneType: return None - elif ct == Any: + elif ct is None or ct == Any: if return_any: return ct else: