From 873301421945cc80ee6d5fd95969203b5b2cae2e Mon Sep 17 00:00:00 2001 From: Eugenio Lacuesta Date: Sat, 19 Mar 2022 12:09:06 -0300 Subject: [PATCH] Replace 'any' ocurrences --- itemadapter/adapter.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/itemadapter/adapter.py b/itemadapter/adapter.py index 641b319..a17bf49 100644 --- a/itemadapter/adapter.py +++ b/itemadapter/adapter.py @@ -271,13 +271,17 @@ def __init__(self, item: Any) -> None: @classmethod def is_item(cls, item: Any) -> bool: - return any(adapter_class.is_item(item) for adapter_class in cls.ADAPTER_CLASSES) + for adapter_class in cls.ADAPTER_CLASSES: + if adapter_class.is_item(item): + return True + return False @classmethod def is_item_class(cls, item_class: type) -> bool: - return any( - adapter_class.is_item_class(item_class) for adapter_class in cls.ADAPTER_CLASSES - ) + for adapter_class in cls.ADAPTER_CLASSES: + if adapter_class.is_item_class(item_class): + return True + return False @classmethod def get_field_meta_from_class(cls, item_class: type, field_name: str) -> MappingProxyType: