From 4b431ffc278d5be231d97ace5570b5a459bfb883 Mon Sep 17 00:00:00 2001 From: xmarre Date: Sat, 14 Mar 2026 09:57:22 +0100 Subject: [PATCH] Add missing docstrings --- comfy_execution/caching.py | 2 ++ tests-unit/execution_test/caching_hashable_test.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/comfy_execution/caching.py b/comfy_execution/caching.py index b690d03a8..d6561ab94 100644 --- a/comfy_execution/caching.py +++ b/comfy_execution/caching.py @@ -47,6 +47,8 @@ class CacheKeySet(ABC): return self.subcache_keys.get(node_id, None) class Unhashable: + """Hashable sentinel used when an input cannot be safely represented.""" + def __init__(self): """Create a hashable sentinel value for unhashable prompt inputs.""" self.value = float("NaN") diff --git a/tests-unit/execution_test/caching_hashable_test.py b/tests-unit/execution_test/caching_hashable_test.py index 31d20de10..5613ac6c4 100644 --- a/tests-unit/execution_test/caching_hashable_test.py +++ b/tests-unit/execution_test/caching_hashable_test.py @@ -2,6 +2,7 @@ from comfy_execution.caching import Unhashable, to_hashable def test_to_hashable_returns_unhashable_for_cyclic_builtin_containers(): + """Ensure self-referential built-in containers terminate as Unhashable.""" cyclic_list = [] cyclic_list.append(cyclic_list) @@ -13,6 +14,7 @@ def test_to_hashable_returns_unhashable_for_cyclic_builtin_containers(): def test_to_hashable_returns_unhashable_when_max_depth_is_reached(): + """Ensure deeply nested built-in containers stop at the configured depth limit.""" nested = current = [] for _ in range(32): next_item = []